Bug 81564
| Summary: | Events do not propagate in disconnected DOM trees | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Erik Arvidsson <arv> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | adamk, ahmad.saleem792, annevk, ap, cdumez, ddkilzer, dglazkov, jwalden+bwo, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Erik Arvidsson
Given a disconnected DOM tree, we should still do the event propagation.
var parent = document.createElement('div');
var child = document.createElement('div');
parent.addEventListener('foo', function(e) { alert(e)}, true);
var event = document.createEvent('Event');
event.initEvent('foo', true, true);
parent.appendChild(child);
child.dispatchEvent(event)
Opera and FIrefox both alert here.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adam Klein
This seems to be due to the inDocument() check at the top of EventDispatcher::ensureEventAncestors:
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/EventDispatcher.cpp#L235
It's been around a long time, dating back to when event dispatch was still in Node.cpp.
Alexey Proskuryakov
What does IE do? If IE and WebKit agree, it would take much more than just Firefox and Opera opinion to make this change necessary.
Alexey Proskuryakov
*** Bug 110353 has been marked as a duplicate of this bug. ***
Erik Arvidsson
(In reply to comment #2)
> What does IE do? If IE and WebKit agree, it would take much more than just Firefox and Opera opinion to make this change necessary.
IE passes the test in bug 110353. This makes WebKit the odd man out.
Alexey Proskuryakov
*** Bug 113336 has been marked as a duplicate of this bug. ***
David Kilzer (:ddkilzer)
*** Bug 114023 has been marked as a duplicate of this bug. ***
David Kilzer (:ddkilzer)
<rdar://problem/13178101>
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.
Ahmad Saleem
Chrome / Blink fixed this in following commit - https://src.chromium.org/viewvc/blink?view=revision&revision=198153
Alexey Proskuryakov
We must have fixed this at some point too, the test passes in Safari 16.