Summary: | It should be possible to re-initialize an Event after it's been dispatched | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, commit-queue, darin, dbates, esprehn+autocc, kangil.han, rniwa, sam | ||||||
Priority: | P2 | Keywords: | WebExposed | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
URL: | https://dom.spec.whatwg.org/#dom-event-initevent | ||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=160664 https://bugs.webkit.org/show_bug.cgi?id=160703 |
||||||||
Attachments: |
|
Description
Chris Dumez
2016-08-07 20:22:00 PDT
Created attachment 285556 [details]
Patch
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. (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. Created attachment 285567 [details]
Patch
Comment on attachment 285567 [details] Patch Clearing flags on attachment: 285567 Committed r204254: <http://trac.webkit.org/changeset/204254> All reviewed patches have been landed. Closing bug. |