Anne van Kesteren

using addEventListener

As you might know the W3C Web APIs Working Group is working on DOM Level 3 Events. When going through such a specification all kinds of issues are raised and resolved. Whether or not things in a specification are going to change depends on existing implementations, how much the web relies on those implementations, use cases and the actual problems the specification is trying to solve… Now Firefox has a bug with addEventListener, but other browsers (Safari, Opera) don’t and we want to keep the specification as is. So here is what you’re going to do:

  1. Check your addEventListener calls;
  2. If you have no clue, change the last parameter to false.

Oh, and Dean Edwards, please don’t use null there, okay? ;-)

So if you have it to true it means you are listining on the capture phase of things and as the events specifications states the capture phase does not reach the event target. So you have to register it on some parent element. In Firefox it does reach the event target at the moment and that’s going to change. So beware.

(See also update on addEventListener from Opera’s very own Web Opener, David Storey.)


  1. Ha ha. OK. Fixed now. :-)

    Posted by Dean Edwards at

  2. I noticed Issue-22 in the closed list, "DOM3EV: Define what read-only means". This definition might be useful for the www-style list. What definition did they decide on?

    Posted by Matthew Raymond at

  3. I doubt that would be useful for :read-only et cetera. It is about DOM attributes being read-only after all. The resolution is not that clear either (search for ISSUE-22). The editor of DOM Level 3 Events is coming up with some text for it I think.

    Posted by Anne at