Bug 148800

Summary: dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, kangil.han, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent
Bug Depends on: 148883    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Chris Dumez
Reported 2015-09-04 09:59:42 PDT
dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set, and should allow dispatching events with an empty type as long as it is initialized: https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1) Currently, WebKit relies on the event type being empty and throws a UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. This is covered by the following newly imported W3C test: http/tests/w3c/dom/events/EventTarget-dispatchEvent.html
Attachments
Patch (28.14 KB, patch)
2015-09-04 10:48 PDT, Chris Dumez
no flags
Patch (28.45 KB, patch)
2015-09-05 11:07 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-09-04 10:00:35 PDT
Chris Dumez
Comment 2 2015-09-04 10:48:02 PDT
Geoffrey Garen
Comment 3 2015-09-04 13:53:27 PDT
Comment on attachment 260597 [details] Patch r=me
WebKit Commit Bot
Comment 4 2015-09-04 14:13:14 PDT
Comment on attachment 260597 [details] Patch Clearing flags on attachment: 260597 Committed r189386: <http://trac.webkit.org/changeset/189386>
WebKit Commit Bot
Comment 5 2015-09-04 14:13:24 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 6 2015-09-04 22:23:16 PDT
WebKit Commit Bot
Comment 7 2015-09-04 22:25:06 PDT
Re-opened since this is blocked by bug 148883
Chris Dumez
Comment 8 2015-09-05 11:07:25 PDT
Chris Dumez
Comment 9 2015-09-05 11:08:20 PDT
Comment on attachment 260694 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=260694&action=review > Source/WebCore/dom/EventTarget.cpp:-194 > - ASSERT(event && !event->type().isEmpty()); Fixed outdated assertion as it is now valid to dispatch an event with an empty type, as long as the event has its initialized flag set to true.
WebKit Commit Bot
Comment 10 2015-09-06 13:41:56 PDT
Comment on attachment 260694 [details] Patch Clearing flags on attachment: 260694 Committed r189452: <http://trac.webkit.org/changeset/189452>
WebKit Commit Bot
Comment 11 2015-09-06 13:42:01 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.