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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25593</bug_id>
          
          <creation_ts>2014-05-07 22:22:03 +0000</creation_ts>
          <short_desc>Access to event listeners in the EventTarget</short_desc>
          <delta_ts>2014-05-08 09:58:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arkadiusz Michalski (Spirit)">crimsteam</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105361</commentid>
    <comment_count>0</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-05-07 22:22:03 +0000</bug_when>
    <thetext>Any plans do this in the future? It would be useful if we have access to all registered event listeners from context:

el.eventListeners &lt;&lt; return some array

And we can loop through this array, get single event listener (read type, callback, capture with the possibility of changes and one method to remove this event listener totally).

If it is completely impossible maybe add to the EventTarget some method to remove all event listeners. Now its not easy... especially when we have a lot of them and some have anonymous callback. We must clone only context, move content, and probably reconstruction some listeners (nothing pleasant).

I just wonder if there any chances of a better API for these things or we must use some additional libraries/tricks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105426</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-08 09:58:31 +0000</bug_when>
    <thetext>We don&apos;t really want to make listeners observable. There&apos;s various places in the platform where this has happened anyway, but I&apos;m not planning on giving in just yet.

As for a better API, I suggest you discuss that on www-dom@w3.org. This is not really a place for brainstorming.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>