Re: finding event "at end of page load", redux

Boris Zbarsky <[email protected]> Tue, 22 Apr 2008 21:04:15 -0500
Newsgroups gmane.comp.mozilla.performance
Message-ID <[email protected]>
Ray Kiddy wrote:
> There seems to be lots of things that happen after onload. For example, 
> others have observed and mentioned to me that they want to wait until 
> images load. Apparently, this may happen after the onload event.

On trunk, only if the images _start_ to load after the onload event.  On branch, 
onload didn't wait for backgrounds, so that might be what people are talking about.

> I have not tried onpageshow.

It fires at the same time as onload, except for history navigation cases.

> Actually, that is why I put "at end of page load" in quotes. I think 
> this phrase means what the speaker wants it to mean.

Right.  I just think it's important to have a clear decision criterion for what 
it means to be "at end of page load" before even bothering to ask the "how do I 
detect it?" question.

> That being said, it would be good to know what events actually represent.

onload represents the completion of all network activity associated with the 
page that began prior to the firing of the onload event.  That is, it represents 
the first time after the page started to load that there are no network 
connections associated with the page that are still in progress.

> Do we have a document that describes the stages of page loading and what 
> events are fired before and after each.

I don't know that we do.  Sounds like possible devmo material.  That said, the 
only events like this that we have are DOMContentLoaded, onload, and onpageshow. 
  DOMContentLoaded is certainly well-documented (including in the HTML5 drafts). 
  There is certainly documentation about how onload and onpageshow differ.

> Bug 286013 – DOM dispatches undocumented events and expects embedders 
> handle them

Yes, I'm well aware of that bug, as you noticed.

> toBug 329514 – Sort out the exact behavior for *LOAD events

Those are all reflected into the DOM as onload events on different targets.

> Boris - You have commented on one of these and created the other. Doing 
> a search on 'load event' turns up lots of others.

Yes, but are they questions about what events mean what, or just questions about 
when the Window's onload event should fire?

-Boris
_______________________________________________
dev-performance mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-performance