Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Replace "as" attribute with "type" #26

Closed
wants to merge 2 commits into from
Closed

Replace "as" attribute with "type" #26

wants to merge 2 commits into from

Conversation

igrigorik
Copy link
Member

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"

Preview: https://rawgit.com/w3c/preload/type/index.html

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"
@igrigorik
Copy link
Member Author

@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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "MAY"?

Copy link
Member Author

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.

Copy link
Member

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.)

Copy link
Member

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.

@annevk
Copy link
Member

annevk commented Jul 10, 2015

Note that @briansmith does not seem convinced this is the right strategy.

@igrigorik
Copy link
Member Author

@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.

@yoavweiss
Copy link
Contributor

LGTM

@marcoscaceres
Copy link
Member

LGTM2

@annevk
Copy link
Member

annevk commented Jul 13, 2015

See whatwg/fetch#64 (comment) for why I think this is the wrong approach after all.

@toddreifsteck
Copy link
Member

Per 8/12 call, Ilya will follow up given recent fetch updates.

@igrigorik
Copy link
Member Author

Closing, we're back to (drumroll) as. See: #29, and step 5 in https://rawgit.com/w3c/preload/processing/index.html#dfn-obtain-the-preload-resource.

@igrigorik igrigorik closed this Aug 21, 2015
@igrigorik igrigorik deleted the type branch February 8, 2016 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants