Bug 33861 - Document is not notified about event listener changes
Summary: Document is not notified about event listener changes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2010-01-19 13:19 PST by Nikolas Zimmermann
Modified: 2019-02-06 09:02 PST (History)
8 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 2010-01-19 13:19:51 PST
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.
Comment 1 Alexey Proskuryakov 2012-08-28 09:45:32 PDT
Does this happen on real web sites? Counting listeners would add a toll on every web site, while benefits seem unlikely to materialize.
Comment 2 Lucas Forschler 2019-02-06 09:02:44 PST
Mass moving XML DOM bugs to the "DOM" Component.