Changeset 128080 in webkit
- Timestamp:
- Sep 10, 2012 11:08:25 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128079 r128080 1 2012-08-31 Jon Lee <jonlee@apple.com> 2 3 The options dictionary in Notification constructor should not accept event listeners 4 https://bugs.webkit.org/show_bug.cgi?id=95538 5 <rdar://problem/12213901> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Make sure the onshow handler added in the options dictionary does not get called. 10 11 * http/tests/notifications/events-in-dictionary-expected.txt: Added. 12 * http/tests/notifications/events-in-dictionary.html: Added. 13 1 14 2012-08-31 Jon Lee <jonlee@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r128078 r128080 1 2012-08-31 Jon Lee <jonlee@apple.com> 2 3 The options dictionary in Notification constructor should not accept event listeners 4 https://bugs.webkit.org/show_bug.cgi?id=95538 5 <rdar://problem/12213901> 6 7 Reviewed by Alexey Proskuryakov. 8 9 The latest spec only allows setting the event listeners after the notification has been created. 10 11 Test: http/tests/notifications/events-in-dictionary.html 12 13 * Modules/notifications/Notification.cpp: 14 (WebCore::Notification::create): Do not look for the event handlers in the options dictionary. 15 1 16 2012-09-04 Robert Hogan <robert@webkit.org> 2 17 -
trunk/Source/WebCore/Modules/notifications/Notification.cpp
r127062 r128080 139 139 140 140 #if ENABLE(NOTIFICATIONS) 141 static void getAndAddEventListener(const AtomicString& eventName, const char* property, const Dictionary& options, Notification* notification)142 {143 RefPtr<EventListener> listener = options.getEventListener(property, notification);144 if (listener)145 notification->addEventListener(eventName, listener.release(), false);146 }147 148 141 PassRefPtr<Notification> Notification::create(ScriptExecutionContext* context, const String& title, const Dictionary& options) 149 142 { … … 154 147 if (options.get("tag", argument)) 155 148 notification->setTag(argument); 156 getAndAddEventListener(eventNames().showEvent, "onshow", options, notification.get());157 getAndAddEventListener(eventNames().closeEvent, "onclose", options, notification.get());158 getAndAddEventListener(eventNames().errorEvent, "onerror", options, notification.get());159 getAndAddEventListener(eventNames().clickEvent, "onclick", options, notification.get());160 149 161 150 notification->suspendIfNeeded();
Note: See TracChangeset
for help on using the changeset viewer.