RESOLVED FIXED 160651
It should be possible to re-initialize an Event after it's been dispatched
https://bugs.webkit.org/show_bug.cgi?id=160651
Summary It should be possible to re-initialize an Event after it's been dispatched
Chris Dumez
Reported 2016-08-07 20:22:00 PDT
It should be possible to re-initialize an Event after it's been dispatched: - https://dom.spec.whatwg.org/#dom-event-initevent Firefox follows the specification but WebKit prevents re-initialization of an already-dispatched event.
Attachments
Patch (3.83 KB, patch)
2016-08-07 20:26 PDT, Chris Dumez
no flags
Patch (8.95 KB, patch)
2016-08-08 09:06 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-08-07 20:26:10 PDT
Darin Adler
Comment 2 2016-08-07 21:53:17 PDT
Comment on attachment 285556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=285556&action=review > Source/WebCore/dom/Event.cpp:73 > void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) What about the other init event functions, for the specific types of events? I think they all have their own separate dispatched() checks. Should their behavior change or not? Do we have tests for those? > Source/WebCore/dom/Event.cpp:76 > - if (dispatched()) > + if (isBeingDispatched()) > return; I am not sure we have enough test coverage; can't tell from the diff. Are there tests that check that we don’t allow reinitialization while being dispatched? > Source/WebCore/dom/Event.cpp:83 > + m_target = nullptr; I don’t see any test coverage for this change.
Chris Dumez
Comment 3 2016-08-08 09:04:15 PDT
(In reply to comment #2) > Comment on attachment 285556 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=285556&action=review > > > Source/WebCore/dom/Event.cpp:73 > > void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) > > What about the other init event functions, for the specific types of events? > I think they all have their own separate dispatched() checks. Should their > behavior change or not? Do we have tests for those? I don't believe we have testing for the ones in the subclasses. I'll look into those in a follow-up as I suspect they will need updating as well. > > > Source/WebCore/dom/Event.cpp:76 > > - if (dispatched()) > > + if (isBeingDispatched()) > > return; > > I am not sure we have enough test coverage; can't tell from the diff. Are > there tests that check that we don’t allow reinitialization while being > dispatched? > > > Source/WebCore/dom/Event.cpp:83 > > + m_target = nullptr; > > I don’t see any test coverage for this change. Ok, I'll add a test to make sure this is covered.
Chris Dumez
Comment 4 2016-08-08 09:06:20 PDT
WebKit Commit Bot
Comment 5 2016-08-08 09:36:57 PDT
Comment on attachment 285567 [details] Patch Clearing flags on attachment: 285567 Committed r204254: <http://trac.webkit.org/changeset/204254>
WebKit Commit Bot
Comment 6 2016-08-08 09:37: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.