[whatwg] Proposal for separating script downloads and execution

Alexandre Morgaut Alexandre.Morgaut at 4d.com
Wed Feb 9 08:55:56 PST 2011


>> The link tag is meant to support a "prefetch" value for the "rel"
>> attribute asking to preemptively cache the resource:
>> - http://blog.whatwg.org/the-road-to-html-5-link-relations#rel-prefetch
>> - http://davidwalsh.name/html5-prefetch
> 
> For <link rel=prefetch> to address the use-case, some event mechanism would
> HAVE to be added to the <link> tag such that the finishing of that
> "prefetching" could be detected. But then what do we do once it's finished
> loading, even if we *do* add some <link> event mechanism to detect it?

We already had requirements for event mechanism on <link> to detect when stylesheet were going to be applied
I most often see now XHR requests with the append of a <style> element to resolve that
Don't like it much

> .execute() would be a terrible idea for <link>, because it would essentially
> morph <link> into a <script> element at that point. Not only is this
> significantly more confusing to web authors for that type of behavioral
> overloading, but I'd guess that all the complicated semantics around the
> <script> element would then have to be duplicated into a <link> tag that is
> being executed.

Well I admit that it can be confusing... 
As maybe the use of <style> for inline CSS vs <link> for external CSS

> It's tempting to suggest that you would then just add a proper <script>
> element with the same URL to accomplish the "execution" of it. This suffers
> a similar fate to many of the hacky workarounds that currently exist: that
> it's based on the assumption that the resource was cached.

As there is "nofollow" and "noreferrer" types, links may take advantage of "nocache" type


More information about the whatwg mailing list