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

[whatwg] Proposal for separating script downloads and execution

From: Alexandre Morgaut <Alexandre.Morgaut@4d.com>
Date: Wed, 9 Feb 2011 17:55:56 +0100
Message-ID: <E112CC3A-4903-4A72-AD0C-473E1322FC2C@4d.com>

>> 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
Received on Wednesday, 9 February 2011 08:55:56 UTC

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