[whatwg] Link.onload; defer on style, depends

Ian Hickson ian at hixie.ch
Mon Apr 27 22:27:15 PDT 2009

On Wed, 25 Mar 2009, Boris Zbarsky wrote:
> > On Sat, 14 Mar 2009, Greg Houston wrote:
> > > On a side note, I can actually attach a functioning onload event to 
> > > a link element in Internet Explorer. Firefox, Safari, and Chrome 
> > > ignore my attempt, and Opera will fire the onload event but not 
> > > update the style of the page.
> > 
> > Since there are already implementations of this I've gone ahead and 
> > defined it.
> I have a question about this text.  It says that the load event is fired 
> asynchronously; that's fine.  However, the page load event is fired 
> synchronously on completion of network activity in some cases (at least 
> in Gecko).  Which means that if no steps are taken to prevent it, if the 
> last resource loading is a stylesheet the load event for the page will 
> fire before the load event for the stylesheet.  It's not clear to me 
> whether this is ok per the spec text.  Note that for image load events 
> such steps to prevent are in fact taken (a pending image load event 
> blocks the page onload from firing).

The spec requires the page 'load' event to be fired asynchronously. 
(There's no black-box way to distinguish this from the case of waiting for 
the other 'load' events to have fired, as far as I can tell.)

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list