[whatwg] Proposal for separating script downloads and execution

Glenn Maynard glenn at zewt.org
Tue Feb 22 18:55:47 PST 2011


On Tue, Feb 22, 2011 at 9:24 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 2/22/11 8:54 PM, Glenn Maynard wrote:
>
>> 3. My (and Nicholas's previous) proposal: Script elements are fetched when
>> inserted into the DOM[1].  An event is dispatched when the script has been
>> fetched, eg. "onfetch" or "onpreload"[2].  A "preload" attribute is added;
>> when true, the script will not be executed when the fetch completes; call
>> script.execute() to run the script.
>>
>
> I strongly prefer this proposal to either of the other two, for what it's
> worth.  Is the concern that this doesn't degrade as nicely in UAs that don't
> support preload or something?  If not, what _are_ the arguments against this
> proposal?  Links to existing discussion are fine if this ground was already
> covered.
>

The main arguments for the readyState approach over this have been: it's
what IE does now, and the "preloading when src is set" has precedent with
images.

I sympathize with that, since they're aiming to improve the likelihood of
being implemented--but the precedent it's drawing on seems like a bad one,
which should be treated as a compatibility hack rather than a precedent for
new APIs.  From what you've been saying it sounds like it would have the
opposite effect, making it so hard to implement that it wouldn't gain
traction.

I also think the other side benefits of this approach are significant, so
long as they don't make it too hard to implement.  That really needs
implementor feedback--if you can give that, let me know if you want a more
detailed recap.

-- 
Glenn Maynard


More information about the whatwg mailing list