[imps] Question about body.onload

Anne van Kesteren annevk at opera.com
Fri Feb 19 05:42:46 PST 2010

On Tue, 16 Feb 2010 15:25:29 +0100, xuzheng_yahoo <xz911jp at yahoo.co.jp>  
> I have question about when should user agent fire the body.onload event.
> Would you like give me some answer or hint?
> 1. When should body.onload event fired.
> I have investigated in HTML5 and find following description in "4.8.7  
> The video element".
> "The user agent finishes fetching the entire media resource"
> Is this the definition of body.onload?


The load event is dispatched after parsing, when nothing in the document  
"delays the load event". See:


> Based on the above definition, I think that body.onload should be fired
> when whole data be complete fetched from network.
> (For example, should be fired before fetched image data is
> complete decoded.)
> Am I correct?

It may be fired before, but dimensions have to be known.

> 2. If body.onload is defined as above, why "delay the load event" is  
> defined again?

You were not looking at the body load event.

> 3. What element may "delay the load event"?
>    What (type of) elements may (should) "delay the load event" supposed  
> by HTML5?

If you click on the definition in


it should give you a list with everything that references it.

Anne van Kesteren

More information about the Implementors mailing list