This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7697 - The type attribute should ammend the Accept header accordingly. HTTP spec is in accordance with the rules here, in terms of the Accept header being non-authorative. script and style elements already ammend accept header (in firefox) but not for other link
Summary: The type attribute should ammend the Accept header accordingly. HTTP spec is ...
Status: VERIFIED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords: NoReply
: 8797 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-22 09:42 UTC by contributor
Modified: 2010-10-04 13:57 UTC (History)
9 users (show)

See Also:


Attachments

Description contributor 2009-09-22 09:42:59 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#hyperlink-elements

Comment:
The type attribute should ammend the Accept header accordingly. HTTP spec is in accordance with the rules here, in terms of the Accept header being non-authorative. script and style elements already ammend accept header (in firefox) but not for other link elements. This behaviour would be valuable for enabling HTML powered applications which leverage HTTP conneg.

Posted from: 213.133.215.122
Comment 1 Ian 'Hixie' Hickson 2009-09-22 11:49:32 UTC
Accept should reflect what the UA accepts, not what the page says the server provides.
Comment 2 Mike Kelly 2009-09-22 12:48:01 UTC
Ian that would appear to be incorrect given that, according to the HTTP spec, the Accept header is simply intended to indicate the appropriate media types for a response to a given request:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

"The Accept request-header field can be used to specify certain media types which are acceptable for the response"

So, the value of the Accept header should be taken (if specified) from the type attribute for a given hyperlink element - which is presumably why firefox modifies the accept header for the style and script elements.

This allows hyperlinks to specific representations that must be negotiated via HTTP content negotiation - as it stands, it is not possible to specify such a link with HTML5.

i.e. currently - these links would actually generate identical requests with the same Accept header: 

<a type='application/xml' href='/document'>document in xml</a>
<a type='application/json' href='/document'>document in json</a>

If implemented any existing mechanisms which disregard the Accept header would remain unaffected by the change. 

If no type is specified then default UA Accept header value should be assumed.

Comment 3 Ian 'Hixie' Hickson 2009-09-22 21:05:16 UTC
HTTP is written with the assumption that client headers are set by the client, not set by an agent of the server (such as the Web content).

If you disagree with this interpretation of the HTTP spec, then please escalate this to the chairs.
Comment 4 Mike Kelly 2009-09-23 08:56:56 UTC
(In reply to comment #3)
> HTTP is written with the assumption that client headers are set by the client,
> not set by an agent of the server (such as the Web content).
> 
> If you disagree with this interpretation of the HTTP spec, then please escalate
> this to the chairs.

In this proposal there would be nothing which prevents a client completely ignoring the guidance of the type attribute - it should be best practice to follow the type attribute this way, but not mandatory.

Also if the UA does not support the media type(s) specified for the link, it can opt to not make the request or make it and revert to its default Accept header.

Either way - it is the client which is ultimately controlling the header.
Comment 5 KevBurnsJr 2009-09-23 16:29:34 UTC
How the client uses the a[type] attribute is up to them, as the type attribute is "purely advisory".  Using the type attribute in the way you've outlined is permitted by the existing specification.  Your example does not suggest any additional constraints, only suggesting best practice.  

While it may be good practice for a client to use the a[type] in the request header, I can see how that implementation detail probably does not belong in the HTML language specification.
Comment 6 Mike Kelly 2009-09-24 23:27:51 UTC
(In reply to comment #5)
> How the client uses the a[type] attribute is up to them, as the type attribute
> is "purely advisory".  Using the type attribute in the way you've outlined is
> permitted by the existing specification.  Your example does not suggest any
> additional constraints, only suggesting best practice.  
> 
> While it may be good practice for a client to use the a[type] in the request
> header, I can see how that implementation detail probably does not belong in
> the HTML language specification.

These mechanisms are impractical unless there is consensus among major clients. 

Is the HTML spec not the best place to define a 'good practice' interpretation of the attribute's significance within a hyperlink?

Comment 7 Henri Sivonen 2010-01-22 07:43:37 UTC
*** Bug 8797 has been marked as a duplicate of this bug. ***
Comment 8 Mike Kelly 2010-01-22 12:27:34 UTC
Ian, please could we continue this discussion - as your responses so far haven't cleared this up for me.
Comment 9 Nick Welch 2010-01-22 18:23:07 UTC
There are already a couple of examples of HTML requiring that the client alter certain headers when sending subsequent requests:


1. HTML5's rel=noreferrer says that "the user agent must not include a Referer (sic) HTTP header (or equivalent for other protocols) in the request."

http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-noreferrer

Note that it even says "must", whereas the proposal in this ticket could presumably be phrased as a suggestion, not a requirement.


2. <form enctype="...">

http://www.w3.org/TR/html401/interact/forms.html#adef-enctype
Comment 10 Maciej Stachowiak 2010-03-14 14:51:35 UTC
This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
  http://dev.w3.org/html5/decision-policy/decision-policy.html

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.