<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>33861</bug_id>
          
          <creation_ts>2010-01-19 13:19:51 -0800</creation_ts>
          <short_desc>Document is not notified about event listener changes</short_desc>
          <delta_ts>2026-03-26 06:05:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cdumez</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>eric</cc>
    
    <cc>mjs</cc>
    
    <cc>staikos</cc>
    
    <cc>tonikitoo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>182410</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2010-01-19 13:19:51 -0800</bug_when>
    <thetext>Document keeps track wheter a certain event listener is available in the DOM, we only dispatch certain events if document()-&gt;hasListenerType(..) returns true.
In Node::addEventListener, we&apos;re adding the listener type, but in Node::removeEventListener we&apos;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. &lt;body&gt; and then removing it. We will never stop dispatching mutation events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>706434</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-08-28 09:45:32 -0700</bug_when>
    <thetext>Does this happen on real web sites? Counting listeners would add a toll on every web site, while benefits seem unlikely to materialize.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502834</commentid>
    <comment_count>2</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:02:44 -0800</bug_when>
    <thetext>Mass moving XML DOM bugs to the &quot;DOM&quot; Component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2193911</commentid>
    <comment_count>3</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2026-03-26 06:05:15 -0700</bug_when>
    <thetext>Mutation events are no longer relevant.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>