W3C home > Mailing lists > Public > public-webapi@w3.org > December 2006

Re: capturing load events

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 29 Dec 2006 18:51:01 +0100
To: Shadow2531 <shadow2531@gmail.com>
Cc: "Hallvord R. M. Steen" <hallvord@opera.com>, public-webapi@w3.org, "Joao Eiras" <joao.eiras@gmail.com>
Message-ID: <ekkap2heo6405vdckemk342q3u0cl93p1r@hive.bjoern.hoehrmann.de>

* 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:56 GMT