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

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

From: Travis Leithead <travil@windows.microsoft.com>
Date: Wed, 9 Apr 2008 17:32:08 -0700
To: Jonas Sicking <jonas@sicking.cc>
CC: Anne van Kesteren <annevk@opera.com>, Doug Schepers <schepers@w3.org>, Web API public <public-webapi@w3.org>
Message-ID: <0003CB8B8FE2154EB50431DB2B8F69C002C6E04F83@NA-EXMSG-W601.wingroup.windeploy.ntdev.microsoft.com>
I'll try to dig up some specific use cases.

Yes, the workaround below would work great as well, until we ratify this API :)

-----Original Message-----
From: Jonas Sicking [mailto:jonas@sicking.cc]
Sent: Wednesday, April 09, 2008 3:49 PM
To: Travis Leithead
Cc: Anne van Kesteren; Doug Schepers; Web API public
Subject: Re: [DOML3Events] ACTION-267 Proposal for event iterator

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 Thursday, 10 April 2008 00:34:36 UTC

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