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

Resp.: capturing load events

From: Joćo Eiras <joao.eiras@gmail.com>
Date: Sun, 31 Dec 2006 01:02:34 +0000
Message-ID: <e72b1b360612301702n453f9d4awf172bb09fae3b9d4@mail.gmail.com>
To: Shadow2531 <shadow2531@gmail.com>
Cc: "Bjoern Hoehrmann" <derhoermi@gmx.net>, "Hallvord R. M. Steen" <hallvord@opera.com>, public-webapi@w3.org

Thank Bjoern,
so, so far I've undestood this, regarding the load event:
1) the window is a target to which event listeners can be dispatched,
different from the document
2) a capturing load event listener in the window will only fire once,
during the load event dispatch for the document
3) a bubbling load event listener in the window will only fire once
when its child document loads. The load event for the document bubbles
to the window only. This is the single exception for the load event in
the entire events specification, where load bubbles. currentTarget
must be the window, the phase must be bubbling

Sadly, 2 is different from the original model, but it's required to
workaround the problems that unwanted event capture caused, due to the
Gecko bug.

Now, how do these rules apply related to other events and the unload event ?

2006/12/30, Shadow2531 <shadow2531@gmail.com>:
> On 12/29/06, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
> > * Shadow2531 wrote:
> > >[...]
> >
> > Try this fragment...
>
> Thanks
>
> Adressing the window + 'true' part first:
>
> <pre id='r'>&#xa;</pre>
> <script>
> function trace(s)
> {document.getElementById('r').firstChild.nodeValue+=s+"\n";}
> window.addEventListener('load',function(e){
> var t=e.target;
> if(window.opera&&t==document.body){t=document;}
> trace("win cap ("+e.eventPhase+") ("+t+")");},true);
> </script>
> <p><img alt='' src='http://www.w3.org/Icons/valid-xhtml10' /></p>
>
> Given that markup,  does Opera produce the desired result?
>
> --
> burnout426
>
Received on Sunday, 31 December 2006 01:02:43 GMT

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