Re: finding event "at end of page load", redux
Ray Kiddy <[email protected]> Wed, 23 Apr 2008 10:10:45 -0700
| Newsgroups | gmane.comp.mozilla.performance |
|---|---|
| Message-ID | <[email protected]> |
Boris Zbarsky wrote: > 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. That makes sense. >> I have not tried onpageshow. > > It fires at the same time as onload, except for history navigation cases. Good to know. >> 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. I agree, except that people _will_ use the phrase "at the end of the page load" regardless of what anyone else thinks they should do so. Perhaps the devmo article you describe below needs to inform them on this. >> 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. This paragraph, and your note about onpageshow above, are exactly the kind of thing the devmo article needs to mention. If you do not write it, I will create the page and steal this info for the page. >> 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? I think they probably _are_ questions about what the events mean. Unfortunately, I do not think that enables us to duck the questions. The more people understand what an event is supposed to mean, the better they will be able to judge whether they should use it and how to not mis-use it. cheers - ray _______________________________________________ dev-performance mailing list [email protected] https://lists.mozilla.org/listinfo/dev-performance