Re: [Events] removeEventListener on EventListeners currently being processed

> 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