[fetch] Replace 'preload' context with context calculated from the |as| attribute (#76)

```<link rel=preload>``` was changed to make the ```as``` attribute mandatory. This was done so that the browser can determine what context-sensitive parameters to supply to the fetch. We should take advantage of this by calculating a fetch context from the ```as``` attribute instead of having a ```preload``` fetch context. For example, ````<link rel=preload as=stylesheet>``` should use ```style``` as the fetch context. And, in particular, there should be no ```preload``` context. This will help ensure that all of the fetch's security checks, prioritization logic, caching header setting, etc. are consistent with what would happen in the non-preload case, so that a response from a preload will more exactly match the response that would be given from a non-preload fetch.

Note that a boolean "is this a preload" flag is still needed so that things like mixed content blocking can treat preloads specially.

Note that this would require a change to MIX, at least, because MIX should continue to block mixed-content preloads. (It already requires them to be blocked since 'preload' is not on the whitelist.) /cc @mikewest.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/76

Received on Wednesday, 8 July 2015 18:47:23 UTC