[webkit-dev] beforeload & link (esp rel prefetch)
Gavin Peters (蓋文彼德斯)
gavinp at chromium.org
Wed Jan 12 08:05:23 PST 2011
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
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?
4. Should HTML Link permit rel=subresource?
5. If the answer to (4) is yes, should HTML Link rel=subresource have
what do people think?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev