Re: capturing load events

* Shadow2531 wrote:
>So far, this is what I get out of everything:
>
>1. window.addEventListener("load", func, false) should fire only one
>load event with the target being the document.

Neither DOM Events nor Window currently allow or require that, the
document's load event would either have to bubble or the model has
to be so that during the target phase listeners on both the window
and the document have to be triggered.

>2. window.addEventListener("load", func, true) should do the exact
>same thing as #1.

That would be very bad, listeners registered for the capture phase
should be triggered only during the capture phase, not during any
other event phase. If `func` should be triggered for both of your
calls above, then it should be triggered twice after

  window.addEventListener("load", func, true);
  window.addEventListener("load", func, false);

>5. 'true' will just be a dummy value when used on a window object (and
>in essence, just mapped to 'false') to make some current pages work
>that should really be using 'false'.

So far the 'load' event is supposed to be an exception, I do not
think anyone suggested this point for all event types.

>6. Instead of window.addEventListener("load", func, true),
>document.addEventListener("load", func, true) will need to be used if
>you really want capturing for the document.

Presumably, yes. Though note that in this case `func` will only
be triggered for load events on descendants of the document,
not for the document's load event.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Friday, 29 December 2006 17:51:14 UTC