Replace "as" attribute with "type" #26
Conversation
For background, see: whatwg/fetch#64 (comment) - type is an advisory attribute on link - type must contain valid mime type - context of the fetch is "preload"
@annevk @yoavweiss PTAL. We'll also need to land appropriate plumbing in Fetch to use "type" to initialize appropriate settings. |
|
||
<li>Request defaults set by the user agent via <code><a>as</a></code> attribute MUST match the default settings set by the user agent when processing a resource with the same context. This behavior is necessary to guarantee correct prioritization and request matching - see <a href="#matching-responses-with-requests"></a>.</li> | ||
<li>The <code><dfn><a href="http://www.w3.org/TR/html5/links.html#attr-hyperlink-type">type</a></dfn></code> attribute is an OPTIONAL attribute whose value MUST be a <a href="http://www.w3.org/TR/html5/infrastructure.html#valid-mime-type">valid MIME type</a> and MAY be used by the user agent to initialize appropriate <a href="https://fetch.spec.whatwg.org/#fetching">fetch settings</a> - e.g. HTTP request headers, request and transport priorities, etc.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "MAY"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcoscaceres previously flagged OPTIONAL -> MUST as an issue, hence I went with MAY. If this is not an issue then I'm happy to change it back to MUST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was his rationale? (Note that OPTIONAL and MAY are equivalent.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @marcoscaceres' was objecting to having the mix of MAY and MUST (otherwise, they are just authoring guidelines which are meh, IMO). The excepted values for the attribute are defined by the element itself (as well as what values the attribute expects). I would expect an algorithm somewhere to define how the UA behaves when an invalid value is given, as well as how processed attribute values are reflected in the IDL attributes of an element.
Note that @briansmith does not seem convinced this is the right strategy. |
@yoavweiss @annevk @marcoscaceres updated the language to "MUST use when present". I'll land this (assuming we agree on this approach) once we resolve whatwg/fetch#64. |
LGTM |
LGTM2 |
See whatwg/fetch#64 (comment) for why I think this is the wrong approach after all. |
Per 8/12 call, Ilya will follow up given recent fetch updates. |
Closing, we're back to (drumroll) |
For background, see:
whatwg/fetch#64 (comment)
Preview: https://rawgit.com/w3c/preload/type/index.html