[whatwg] API to delay the document load event

Lee Kowalkowski lee.kowalkowski at googlemail.com
Mon Apr 29 04:12:39 PDT 2013


On 24 April 2013 12:51, Robert O'Callahan <robert at ocallahan.org> wrote:
> Context: https://bugzilla.mozilla.org/show_bug.cgi?id=863499
>
> Proposal:
> Give Web applications APIs to explicitly delay the document load event. In
> particular, add a method "document.delayLoadEvent()" that causes the
> document load event to be delayed until a corresponding
> "document.stopDelayingLoadEvent()" method is called. Allow these to nest so
> that the document load event is delayed until at least as many calls to
> stopDelayingLoadEvent() have been made as there were calls to
> delayLoadEvent().

Is it only me that finds this potentially recursive?  If the load
event is too early to capture a thumbnail because there might be other
tasks waiting for the load event before they contribute to the initial
page rendering, then how does delaying the load event help?

I think if a page continues its initial rendering after the load event
has been fired, then that's the issue, why was the page created that
way in the first place?  All of my Chrome thumbnails under 'Most
Visited' look fine.

Also, do these thumbnail capture activities definitely work on the
onload event?  Can't they be more intelligent? (e.g. wait for
DOM/network inactivity or a maximum of 30 seconds).

If the page author really wanted control over this, why do they need
something complicated like .delayLoadEvent() and
.stopDelayingLoadEvent() and not just .captureThumbnail(), or
something to put into a <meta> element more suited to the purpose of
capturing/providing thumbnail images.

--
Lee



More information about the whatwg mailing list