W3C home > Mailing lists > Public > public-webapi@w3.org > January 2007

Re: capturing load events

From: Shadow2531 <shadow2531@gmail.com>
Date: Mon, 1 Jan 2007 17:14:56 -0500
Message-ID: <6b9c91b20701011414h3d60112fseedd388134b7b8ea@mail.gmail.com>
To: "João Eiras" <joao.eiras@gmail.com>
Cc: "Bjoern Hoehrmann" <derhoermi@gmx.net>, "Hallvord R. M. Steen" <hallvord@opera.com>, public-webapi@w3.org
On 12/31/06, João Eiras <joao.eiras@gmail.com> wrote:
> > So, my question is, what's the reason for not wanting win t+b(2) to
> fire?
> The load event doesn't bubble, so it fires with the Document as
> target, and doesn't go up. But compatibility with the current web
> demands this.

Thanks João.

O.K., so we're just saying that window.addEventListener("load", func,
false) doesn't make sense, *technically*, because the document load
doesn't bubble up to the window.

So, it seems that:
win cap (1) ([object HTMLImageElement])
doc cap (1) ([object HTMLImageElement])
win cap (1) ([object HTMLDocument])
doc t+b (2) ([object HTMLDocument])
win t+b (2) ([object HTMLDocument])

is the way to go because it doesn't break the 'false' behavior and it
allows 'true' to work as mosts sites intend. (Opera can produce that
with the body -> document target fixes.)

Assuming the 'true' +"load" behavior for window.addEventListener is
solved, the the only problem is how to explain how
window.addEventListener("load", func, false) can work if load doesn't

So, since we still need  window.addEventListener("load", func, false)
to work, can we just have the window spec say that in the case of
"load" and 'false' for window.addEventListener,
window.addEventListener("load", func, false) is just an alias to
document.addEventListener("load", func, false)?

That appears to be what Opera does anyway (or close to it)

window.addEventListener("load", function() {
}, false);

'this' is HTMLDocument in Opera. In FF it's 'window'.

And with:

function test() {
window.addEventListener("load", test, false);
document.removeEventListener("load", test, false);

you won't see an alert in Opera.

Received on Monday, 1 January 2007 22:15:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:22 UTC