ISSUE-77 - Public View

DOM3EV: Effect of evt.currentTarget.add/removeEL

State:
CLOSED
Product:
DOM 3 Events
Raised by:
Bjoern Hoehrmann
Opened on:
2006-04-19
Description:
The effects of evt.currentTarget.add/removeEventListener are well-
defined in the current draft but implementations vary. I would like
to confirm that the current requirements are really desired so I
can improve the wording for it. The effect of

  evt.currentTarget.addEventListener(...)

is deferred, the listener will not be triggered by in the current
phase. The effect of

  evt.currentTarget.removeEventListener(...)

is immediate, the removed listener will not be triggered until it
is added again. This implies that doing (for the same listener)

  evt.currentTarget.removeEventListener(...)
  evt.currentTarget.addEventListener(...)

would prevent the listener from being triggerd in the current
phase (and the position probably changes when triggered by another
event). Test cases for this include

http://bjoernsworld.de/temp/remove-listener-from-current-target.html
http://bjoernsworld.de/temp/remove-listener-from-current-target.svg
http://bjoernsworld.de/temp/remove-listener-from-current-target-and-re-add.html
http://bjoernsworld.de/temp/remove-listener-from-current-target-and-re-add.svg

Opera9 fails both, Batik 1.6.0 passes both, Mozilla passes the first
and fails the second, and I'm told for Safari it depends on the version.

I think it would be more logical if mutations are handled exactly like
mutations to the document tree affect the DOM event flow, that is, they
don't affect it at all (the effect would be deferred for both methods);
failing that it would be more logical if the effect of both methods is
immediate. I don't feel strongly about changing it though.

So, do we want the current behavior?

Note: Some of these links may be accessible only to W3C Members.

Related emails:
  1. ISSUE-77: DOM3EV: Effect of evt.currentTarget.add/removeEL (from dean+cgi@w3.org on 2006-04-19)
  2. Re: DOM3EV: Editorial comments (from derhoermi@gmx.net on 2006-04-19)
  3. Re: ISSUE-77: DOM3EV: Effect of evt.currentTarget.add/removeEL (from jonas@sicking.cc on 2006-04-23)
  4. Re: ISSUE-77: DOM3EV: Effect of evt.currentTarget.add/removeEL (from derhoermi@gmx.net on 2006-04-23)

Related notes:

No additional notes.