W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] Proposal for separating script downloads and execution

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 9 Feb 2011 06:14:57 -0500
Message-ID: <AANLkTi=V0Jg1gns1zaJi1nygr8UVJfNOq0pyz_Og=s6i@mail.gmail.com>
> On Wed, Feb 9, 2011 at 12:08 PM, Alexandre Morgaut
> <Alexandre.Morgaut at 4d.com> wrote:
> > Another approach:
> > The link tag is meant to support a "prefetch" value for the "rel"
> > asking to preemptively cache the resource:
> >  - http://blog.whatwg.org/the-road-to-html-5-link-relations#rel-prefetch
> >  - http://davidwalsh.name/html5-prefetch
> > We can then write:
> > <link rel="prefetch" type="text/javascript" src="myscript.js">
> > let the link HTML Element have an execute() method when the "type"
> > is one off a User-Agent supported Scripting Media Types:

Executing scripts out of a <link> seems very strange.

Prefetching can also be disabled by the user, heuristically disabled by the
browser or download at a lower priority.  There's no way to know in advance
whether that will happen--not just due to lack of an API to ask, but because
the browser can't always tell in advance.  Prefetching is a hint, where
script preloading shouldn't be; loaders must be able to know whether they
can load-without-executing or not.

Glenn Maynard
Received on Wednesday, 9 February 2011 03:14:57 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:30 UTC