[webkit-dev] beforeload & link (esp rel prefetch)

Gavin Peters (蓋文彼德斯) gavinp at chromium.org
Wed Jan 12 08:05:23 PST 2011


Folks,

Right now in WebKit, beforeload events are not universally sent for link
elements.  In particular, link elements with the rel type icon, dns-prefetch
and prefetch do not generate beforeload events.  In a recent review of bug
51941, ap raised the question that perhaps they should be sent.  It's a good
question!

As background, I'm right now refactoring the HTMLLinkElement to pull out the
loader that handles the abovementioned three rel types.  I'm doing this in
preparation for adding Link header support, initially for these three rel
types, as they are not so controversial as for instance putting
rel=stylesheet in the HTTP headers.

Then, there's another complication.  After the refactoring described in bug
51941, I'd like to move on and implement the Link header, bug 51940.  It's
clear that beforeload won't make sense for the Link header, since we can't
allow JS in HTTP, and we can't delay following the Link until we have
HTML+CSS+JS (since that would defeat the purpose of the HTTP header
providing quick dispatch).  As well, I will likely add another rel type
"subresource" to our handling together with the header, which describes
something like a prefetch, but required for the current page.

So now I see a few questions

   1. Should HTML Link rel=prefetch have beforeload events?
   2. How about rel=icon and rel=dns-prefetch ?
   3. If the answer to (1) is yes, then should HTTP Link have events?
    Really?
   4. Should HTML Link permit rel=subresource?
   5. If the answer to (4) is yes, should HTML Link rel=subresource have
   beforeload events?

what do people think?

- Gavin

https://bugs.webkit.org/show_bug.cgi?id=51941
https://bugs.webkit.org/show_bug.cgi?id=51940
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110112/95afd7df/attachment.html>


More information about the webkit-dev mailing list