Changeset 90972 in webkit
- Timestamp:
- Jul 13, 2011 7:25:55 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90971 r90972 1 2011-07-12 Dominic Cooney <dominicc@chromium.org> 2 3 Raise if dispatchEvent dispatches an event that is being dispatched 4 https://bugs.webkit.org/show_bug.cgi?id=64150 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/Window/window-properties-expected.txt: Added DISPATCH_REQUEST_ERR. 9 * fast/events/dispatch-event-being-dispatched-expected.txt: Added. 10 * fast/events/dispatch-event-being-dispatched.html: Added. 11 * fast/workers/resources/worker-event-listener.js: 12 (onmessage): Redispatching the MessageEvent throws an exception now. 13 * platform/gtk/fast/dom/Window/window-properties-expected.txt: 14 * platform/qt-wk2/fast/dom/Window/window-properties-expected.txt: 15 * platform/qt/fast/dom/Window/window-properties-expected.txt: 16 1 17 2011-07-13 Kent Tamura <tkent@chromium.org> 2 18 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r88020 r90972 936 936 window.Event.prototype.stopPropagation [function] 937 937 window.EventException [object EventExceptionConstructor] 938 window.EventException.DISPATCH_REQUEST_ERR [number] 938 939 window.EventException.UNSPECIFIED_EVENT_TYPE_ERR [number] 939 940 window.EventException.prototype [object EventExceptionPrototype] 941 window.EventException.prototype.DISPATCH_REQUEST_ERR [number] 940 942 window.EventException.prototype.UNSPECIFIED_EVENT_TYPE_ERR [number] 941 943 window.EventException.prototype.toString [function] -
trunk/LayoutTests/fast/workers/resources/worker-event-listener.js
r38567 r90972 8 8 function onmessage(evt) 9 9 { 10 try { 11 removeEventListener("message", onmessage, true); 12 addEventListener("message", function(e) { e.foo = "bar" }, true); 13 dispatchEvent(evt); 14 postMessage((evt.foo == "bar") ? "SUCCESS" : "FAIL"); 15 } catch (ex) { 16 postMessage(ex); 17 } 10 postMessage("SUCCESS"); 18 11 } 19 12 -
trunk/LayoutTests/platform/gtk/fast/dom/Window/window-properties-expected.txt
r89294 r90972 936 936 window.Event.prototype.stopPropagation [function] 937 937 window.EventException [object EventExceptionConstructor] 938 window.EventException.DISPATCH_REQUEST_ERR [number] 938 939 window.EventException.UNSPECIFIED_EVENT_TYPE_ERR [number] 939 940 window.EventException.prototype [object EventExceptionPrototype] 941 window.EventException.prototype.DISPATCH_REQUEST_ERR [number] 940 942 window.EventException.prototype.UNSPECIFIED_EVENT_TYPE_ERR [number] 941 943 window.EventException.prototype.toString [function] -
trunk/LayoutTests/platform/qt-wk2/fast/dom/Window/window-properties-expected.txt
r89732 r90972 932 932 window.Event.prototype.stopPropagation [function] 933 933 window.EventException [object EventExceptionConstructor] 934 window.EventException.DISPATCH_REQUEST_ERR [number] 934 935 window.EventException.UNSPECIFIED_EVENT_TYPE_ERR [number] 935 936 window.EventException.prototype [object EventExceptionPrototype] 937 window.EventException.prototype.DISPATCH_REQUEST_ERR [number] 936 938 window.EventException.prototype.UNSPECIFIED_EVENT_TYPE_ERR [number] 937 939 window.EventException.prototype.toString [function] -
trunk/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
r89732 r90972 932 932 window.Event.prototype.stopPropagation [function] 933 933 window.EventException [object EventExceptionConstructor] 934 window.EventException.DISPATCH_REQUEST_ERR [number] 934 935 window.EventException.UNSPECIFIED_EVENT_TYPE_ERR [number] 935 936 window.EventException.prototype [object EventExceptionPrototype] 937 window.EventException.prototype.DISPATCH_REQUEST_ERR [number] 936 938 window.EventException.prototype.UNSPECIFIED_EVENT_TYPE_ERR [number] 937 939 window.EventException.prototype.toString [function] -
trunk/Source/WebCore/ChangeLog
r90971 r90972 1 2011-07-12 Dominic Cooney <dominicc@chromium.org> 2 3 Raise if dispatchEvent dispatches an event that is being dispatched 4 https://bugs.webkit.org/show_bug.cgi?id=64150 5 6 Reviewed by Dimitri Glazkov. 7 8 Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-EventTarget-dispatchEvent 9 10 Test: fast/events/dispatch-event-being-dispatched.html 11 12 * dom/Event.h: 13 (WebCore::Event::isBeingDispatched): Added. 14 * dom/EventException.h: 15 * dom/EventException.idl: Add DISPATCH_REQUEST_ERR. 16 * dom/EventTarget.cpp: 17 (WebCore::EventTarget::dispatchEvent): Raise if being dispatched. 18 * dom/ExceptionCode.cpp: Add gunk for DISPATCH_REQUEST_ERR. 19 1 20 2011-07-13 Kent Tamura <tkent@chromium.org> 2 21 -
trunk/Source/WebCore/dom/Event.h
r89044 r90972 172 172 virtual Clipboard* clipboard() const { return 0; } 173 173 174 bool isBeingDispatched() const { return eventPhase(); } 174 175 175 176 protected: -
trunk/Source/WebCore/dom/EventException.h
r34432 r90972 45 45 46 46 enum EventExceptionCode { 47 UNSPECIFIED_EVENT_TYPE_ERR = EventExceptionOffset 47 UNSPECIFIED_EVENT_TYPE_ERR = EventExceptionOffset, 48 DISPATCH_REQUEST_ERR 48 49 }; 49 50 -
trunk/Source/WebCore/dom/EventException.idl
r89269 r90972 46 46 // EventExceptionCode 47 47 const unsigned short UNSPECIFIED_EVENT_TYPE_ERR = 0; 48 48 const unsigned short DISPATCH_REQUEST_ERR = 1; 49 49 }; 50 50 -
trunk/Source/WebCore/dom/EventTarget.cpp
r89567 r90972 327 327 } 328 328 329 if (event->isBeingDispatched()) { 330 ec = EventException::DISPATCH_REQUEST_ERR; 331 return false; 332 } 333 329 334 if (!scriptExecutionContext()) 330 335 return false; … … 338 343 event->setCurrentTarget(this); 339 344 event->setEventPhase(Event::AT_TARGET); 340 return fireEventListeners(event.get()); 345 bool defaultPrevented = fireEventListeners(event.get()); 346 event->setEventPhase(0); 347 return defaultPrevented; 341 348 } 342 349 … … 448 455 449 456 } // namespace WebCore 450 -
trunk/Source/WebCore/dom/ExceptionCode.cpp
r87961 r90972 113 113 114 114 static const char* const eventExceptionNames[] = { 115 "UNSPECIFIED_EVENT_TYPE_ERR" 115 "UNSPECIFIED_EVENT_TYPE_ERR", 116 "DISPATCH_REQUEST_ERR" 116 117 }; 117 118 118 119 static const char* const eventExceptionDescriptions[] = { 119 "The Event's type was not specified by initializing the event before the method was called." 120 "The Event's type was not specified by initializing the event before the method was called.", 121 "The Event object is already being dispatched." 120 122 }; 121 123
Note: See TracChangeset
for help on using the changeset viewer.