W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2012

[whatwg] should we add beforeload/afterload events to the web platform?

From: Roman Rudenko <roman@mobify.com>
Date: Thu, 12 Jan 2012 23:50:09 -0800
Message-ID: <CAOtd2HVMWO43hWLxuPP1yCeJ_AO3229p3i7qW7j4EpsVKSE+Fw@mail.gmail.com>
On Thu, Jan 12, 2012 at 6:59 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> On 1/12/12 9:23 PM, Roman Rudenko wrote:
>>
>> Blocking is possible under some circumstances. Webkit differentiates
>> between normal parser and speculative parser. Speculative parser is
>> launched only if normal parser is blocked on execution of a script.
>> So, one could use beforeload to block resources in Webkit, for as long
>> as no synchronous scripts are allowed to slip through. Unfortunately,
>> one runaway script blocks the parser and spoils blocking for anything
>> after itself.
>
>
> I just thought about this some more... ?This caveat makes beforeload not
> very helpful for blocking or redirecting loads from only part of a document,
> and for blocking loads from the whole document there are the better
> solutions mentioned earlier in this thread.

True. In its current form, beforeload is not very useful for partial processing.
What if we had 'beforedownload' event specifically for resource
fetching, and constructed stub elements to feed it as event.target
when load is readahead-induced? Even the basic tagName + attributes
stub with no manipulation or way to find own context would be useful
and not particularly hard to construct.

-- 
Roman Rudenko
Received on Thursday, 12 January 2012 23:50:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:10 UTC