W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: [Events] removeEventListener on EventListeners currently being processed

From: David Brownell <david-b@pacbell.net>
Date: Sat, 18 Aug 2001 19:41:24 -0700
To: Curt Arnold <carnold@houston.rr.com>, www-dom@w3.org
Message-id: <053901c12858$70bdbb00$6800000a@brownell.org>
> It would be good to hear the rationale why the behavior in the spec is
> undesirable and get a survey of current implementations.

The "DOM2" implementation, currently hosted as "gnu.xml.dom.*" at


scans each node's listeners and collects the ones interested in each
event (so adding listeners to that node during event delivery to it
is a NOP) and then delivers events to all of those.

That is, addition and removal of listeners have comparable behaviors
with respect to a node's "listener set" during event delivery:  all such
adds/removes are ignored until the next node's deliveries start.

I tend to think that the spec should require that behavior for removal.
It's more consistent with behavior during addition, so the principle
of least surprises applies.  It also reduces per-node costs for event

- Dave

p.s. This was probably the first implementation of DOM Level 2
    that supported events (yep, months before Xerces).  I'm curious:
    does anyone recall when that "remove" requirement went in?
    I could believe it's always been there, or that it crept in during
    some later draft.
Received on Saturday, 18 August 2001 22:42:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC