Bug 33861
| Summary: | Document is not notified about event listener changes | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nikolas Zimmermann <zimmermann> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Major | CC: | ap, cdumez, darin, ddkilzer, eric, mjs, staikos, tonikitoo |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
Nikolas Zimmermann
Document keeps track wheter a certain event listener is available in the DOM, we only dispatch certain events if document()->hasListenerType(..) returns true.
In Node::addEventListener, we're adding the listener type, but in Node::removeEventListener we're not notifying the Document that something changed.
We need to switch to a counting based tracking scheme, counting how many event listeners are registered for each event type.
This bug can introduce performance problems, when adding a mutation event listener once for ie. <body> and then removing it. We will never stop dispatching mutation events.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Does this happen on real web sites? Counting listeners would add a toll on every web site, while benefits seem unlikely to materialize.
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.