[preload] Mandatory `as` value and related spec alignments
The motivation for this change is to avoid double downloads following developer
confusion around empty `as` values, enable feature detection of supported `as`
values, and simplify the HTML processing model. Details below:
* Avoid fetching a resource if `as` is missing - we've seen many cases where
developers omit the `as` value from their preload links, which often results in
double downloads. We've also had developer feedback that an empty `as` value
being mapped to XHR/fetch() feels magical. This change addresses that, by defining
a "fetch" value for these cases and ignoring empty/missing `as` values.
* Properly reflect a limited set of known `as` values - enable feature detection of
supported `as` values (instead of the `onerror` based fallback, which we're
deprecating.
* Avoid triggering the "onerror" event when an invalid `as` value is encountered -
simplify HTML's processing model.
BUG=
726647,
715690,
698520
Review-Url:
https://codereview.chromium.org/2903653005
Cr-Commit-Position: refs/heads/master@{#476840}
Committed:
https://chromium.googlesource.com/chromium/src/+/1f18863cc9b2a5fe463671f3eb60de2f95bbf283