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

Ray Kiddy <[email protected]> Tue, 22 Apr 2008 17:07:36 -0700
Newsgroups gmane.comp.mozilla.performance
Message-ID <[email protected]>
Boris Zbarsky wrote:
> Ray Kiddy wrote:
>> But the question of what event one could look for that would represent 
>> the end of the page loading is a complicated one. Right now, my 
>> extension looks for the first DOMContentLoaded that occurs after an 
>> onload.
> 
> What's wrong with using onload or onpageshow?  You're trying to catch 
> cases where the page's onload handler makes some changes to the DOM?
> 

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.

I have not tried onpageshow.

> If so, how do you define "loaded" for http://news.bbc.co.uk or some 
> other page that has a JS ticker?
> 
> -Boris

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. I have, at other 
times, discussed events and have also said that the use of Ajax stuff 
makes this phrase mean less and less.

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

For example, there are many stages in the process of page loading. I 
recall that Dave Hyatt (the guy who works at Apple) had written about 
the stages, as he sees them, when writing about performance issues. I 
wish I could find that post.

Do we have a document that describes the stages of page loading and what 
events are fired before and after each. There seem to be more than a few 
bugs asking for the meaning of events. There also seem to be multiple 
newsgroup posts about this. Just from a quick scan of bugzilla, I see:

Bug 286013 – DOM dispatches undocumented events and expects embedders 
handle them
toBug 329514 – Sort out the exact behavior for *LOAD events


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

- ray




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