You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
W3 Validator reports error for <link> with as attribute #901
W3 validator reports error for the following tag, <link href="/css/0919b1814a0e43ed7c9049ed6289f912a857a8b8a.cbb3cd6b.chunk.css" rel="prefetch" as="style">↩
The as attribute specifies the potential destination for a preload request for the resource given by the href attribute. It is an enumerated attribute. Each potential destination is a keyword for this attribute, mapping to a state of the same name. The attribute must be specified on link elements that have a rel attribute that contains the preload keyword. It may be specified on link elements that have a rel attribute that contains the modulepreload keyword; in such cases it must have a value which is a script-like destination. For other link elements, it must not be specified.
A link element with rel=prefetch is an other link elements case, covered in the last sentence of the above paragraph. So the HTML spec say that as must not be specified for rel=prefetch link elements.
Activity
sideshowbarker commentedon Jan 22, 2020
The relevant requirements are stated in the HTML spec, here:
https://html.spec.whatwg.org/multipage/semantics.html#attr-link-as
A link element with
rel=prefetchis an otherlinkelements case, covered in the last sentence of the above paragraph. So the HTML spec say thatasmust not be specified forrel=prefetchlink elements.The requirement needs to be stated in the HTML spect. To get it added to the HTML spec, I suggest raising an issue at https://github.com/whatwg/html/issues — or else, raising an issue at https://github.com/w3c/resource-hints/issues, to suggest to the Resource Hints spec editor that they port that requirement from the Resource Hints spec to the HTML spec.
Allow "as" attribute with link[rel=prefetch]