W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

Re: [DOML3Events] ACTION-267 Proposal for event iterator

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 09 Apr 2008 15:48:47 -0700
Message-ID: <47FD47CF.907@sicking.cc>
To: Travis Leithead <travil@windows.microsoft.com>
CC: Anne van Kesteren <annevk@opera.com>, Doug Schepers <schepers@w3.org>, Web API public <public-webapi@w3.org>

Travis Leithead wrote:
> From your link, it appears the only reason this was dropped was because the folks in discussion at the time thought the only use case for this feature was Accessibility venders (ATs).

It wasn't just dropped because it wasn't needed (because AT doesn't need 
to use DOM APIs). It was also dropped since it would mean that internal 
code can not use the generic DOM APIs to add event listeners. This is 
something that we do a lot in Firefox code and that is done by a lot of 
Firefox extensions. See
and the followups.

I agree that this is something that we could work around if absolutely 
needed. I'm definitely an advocate for not designing Web APIs for 
internal consumers. However it is always a very nice bonus when public 
APIs are also useful internally.

So I too would be interested in hearing more about the use cases here. 
Could the following be used as a solution?

oldAddEL = EventTarget.prototype.addEventListener;
Node.prototype.addEventListener = function(type,
   listener, useCapture) {
   if (!this.getUserData("listeners")) {
     this.setUserData("listeners", [], null);
   oldAddEL.call(this, type, listener, useCapture);

This should let the page access all listeners added to any node using 

/ Jonas
Received on Wednesday, 9 April 2008 22:51:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:10:00 UTC