[html5] r1784 - /
whatwg at whatwg.org
whatwg at whatwg.org
Tue Jun 17 21:26:04 PDT 2008
Author: ianh
Date: 2008-06-17 21:26:03 -0700 (Tue, 17 Jun 2008)
New Revision: 1784
Modified:
index
source
Log:
[giow] (2) Revamp the way that type='' on <link> is defined to actually be accurate. Allow sniffing when the expected type is an image.
Modified: index
===================================================================
--- index 2008-06-18 03:37:26 UTC (rev 1783)
+++ index 2008-06-18 04:26:03 UTC (rev 1784)
@@ -7666,7 +7666,8 @@
then the <code title=attr-link-media><a href="#media0">media</a></code>
attribute is prescriptive. The user agent must apply the external resource
to <span>views</span><!-- XXX xref --> while their state match the listed
- media, and must not apply them otherwise.
+ media and the other relevant conditions apply, and must not apply them
+ otherwise.
<p id=default-media>The default, if the <code title=attr-link-media><a
href="#media0">media</a></code> attribute is omitted, is <code>all</code>,
@@ -7685,26 +7686,48 @@
href="#refsRFC2046">[RFC2046]</a>
<p>For <a href="#links1" title="external resource link">external resource
- links</a>, user agents may use the type given in this attribute to decide
- whether or not to consider using the resource at all. If the UA does not
- support the given MIME type for the given link relationship, then the UA
- may opt not to download and apply the resource.
+ links</a>, the <code title=attr-link-type><a href="#type">type</a></code>
+ attribute is used as a hint to user agents so that they can avoid
+ downloading resources they do not support. If the attribute is present,
+ then the user agent must assume that the resource is of the given type. If
+ the attribute is omitted, but the external resource link type has a
+ default type defined, then the user agent must assume that the resource is
+ of that type. If the UA does not support the given MIME type for the given
+ link relationship, then the UA should not download the resource; if the UA
+ does support the given MIME type for the given link relationship, then the
+ UA should download the resource. If the attribute is omitted, and the
+ external resource link type does not have a default type defined, but the
+ user agent would fetch the resource if the type was known and supported,
+ then the user agent should fetch the resource under the assumption that it
+ will be supported.
<p>User agents must not consider the <code title=attr-link-type><a
href="#type">type</a></code> attribute authoritative — upon fetching
- the resource, user agents must not use metadata included in the link to
- the resource to determine its type.
+ the resource, user agents must not use the <code title=attr-link-type><a
+ href="#type">type</a></code> attribute to determine its actual type. Only
+ the actual type (as defined in the next paragraph) is used to determine
+ whether to <em>apply</em> the resource, not the aforementioned assumed
+ type.
- <p>If the attribute is omitted, but the user agent would fetch the resource
- if the type was known and supported, then the user agent must fetch the
- resource and determine its type <a href="#content-type8"
- title=Content-Type>from its Content-Type metadata</a> to determine if it
- supports (and can apply) that external resource. If no type metadata is
- specified, but the external resource link type has a default type defined,
- then the user agent must assume that the resource is of that type.
+ <p>If the resource is expected to be an image, user agents may apply the <a
+ href="#content-type6" title="Content-Type sniffing: image">image sniffing
+ rules</a>, with the <var title="">official type</var> being the type
+ determined from the resource's <a href="#content-type8"
+ title=Content-Type>Content-Type metadata</a>, and use the resulting
+ sniffed type of the resource as if it was the actual type. Otherwise, if
+ the resource is not expected to be an image, or if the user agent opts not
+ to apply those rules, then the user agent must use the resource's <a
+ href="#content-type8" title=Content-Type>Content-Type metadata</a> to
+ determine the type of the resource. If there is no type metadata, but the
+ external resource link type has a default type defined, then the user
+ agent must assume that the resource is of that type.
+ <p>Once the user agent has established the type of the resource, the user
+ agent must apply the resource if it is of a supported type and the other
+ relevant conditions apply, and must ignore the resource otherwise.
+
<div class=example>
- <p>If a document contains four style sheet links labeled as follows:</p>
+ <p>If a document contains style sheet links labeled as follows:</p>
<pre><link rel="stylesheet" href="A" type="text/plain">
<link rel="stylesheet" href="B" type="text/css">
@@ -34085,8 +34108,8 @@
<p>User agents must ignore any rows for image types that they do not
support.
- <p>Otherwise, the <i>sniffed type</i> of the resource is the same as its
- <var title="">official type</var>.
+ <p>Otherwise, the sniffed type of the resource is the same as its <var
+ title="">official type</var>.
<h4 id=content-type3><span class=secno>4.10.4 </span><dfn
id=content-type7>Content-Type sniffing: feed or HTML</dfn></h4>
Modified: source
===================================================================
--- source 2008-06-18 03:37:26 UTC (rev 1783)
+++ source 2008-06-18 04:26:03 UTC (rev 1784)
@@ -6041,7 +6041,8 @@
then the <code title="attr-link-media">media</code> attribute is
prescriptive. The user agent must apply the external resource to
<span>views</span><!-- XXX xref --> while their state match the
- listed media, and must not apply them otherwise.</p>
+ listed media and the other relevant conditions apply, and must not
+ apply them otherwise.</p>
<p id="default-media">The default, if the <code
title="attr-link-media">media</code> attribute is omitted, is
@@ -6059,30 +6060,52 @@
href="#refsRFC2046">[RFC2046]</a></p>
<p>For <span title="external resource link">external resource
- links</span>, user agents may use the type given in this attribute
- to decide whether or not to consider using the resource at all. If
- the UA does not support the given MIME type for the given link
- relationship, then the UA may opt not to download and apply the
- resource.</p>
+ links</span>, the <code title="attr-link-type">type</code> attribute
+ is used as a hint to user agents so that they can avoid downloading
+ resources they do not support. If the attribute is present, then the
+ user agent must assume that the resource is of the given type. If
+ the attribute is omitted, but the external resource link type has a
+ default type defined, then the user agent must assume that the
+ resource is of that type. If the UA does not support the given MIME
+ type for the given link relationship, then the UA should not
+ download the resource; if the UA does support the given MIME type
+ for the given link relationship, then the UA should download the
+ resource. If the attribute is omitted, and the external resource
+ link type does not have a default type defined, but the user agent
+ would fetch the resource if the type was known and supported, then
+ the user agent should fetch the resource under the assumption that
+ it will be supported.</p>
<p>User agents must not consider the <code
title="attr-link-type">type</code> attribute authoritative —
- upon fetching the resource, user agents must not use metadata
- included in the link to the resource to determine its type.</p>
+ upon fetching the resource, user agents must not use the <code
+ title="attr-link-type">type</code> attribute to determine its actual
+ type. Only the actual type (as defined in the next paragraph) is
+ used to determine whether to <em>apply</em> the resource, not the
+ aforementioned assumed type.</p>
- <p>If the attribute is omitted, but the user agent would fetch the
- resource if the type was known and supported, then the user agent
- must fetch the resource and determine its type <span
- title="Content-Type">from its Content-Type metadata</span> to
- determine if it supports (and can apply) that external resource. If
- no type metadata is specified, but the external resource link type
- has a default type defined, then the user agent must assume that the
- resource is of that type.</p>
+ <p>If the resource is expected to be an image, user agents may apply
+ the <span title="Content-Type sniffing: image">image sniffing
+ rules</span>, with the <var title="">official type</var> being the
+ type determined from the resource's <span
+ title="Content-Type">Content-Type metadata</span>, and use the
+ resulting sniffed type of the resource as if it was the actual
+ type. Otherwise, if the resource is not expected to be an image, or
+ if the user agent opts not to apply those rules, then the user agent
+ must use the resource's <span title="Content-Type">Content-Type
+ metadata</span> to determine the type of the resource. If there is
+ no type metadata, but the external resource link type has a default
+ type defined, then the user agent must assume that the resource is
+ of that type.</p>
+ <p>Once the user agent has established the type of the resource, the
+ user agent must apply the resource if it is of a supported type and
+ the other relevant conditions apply, and must ignore the resource
+ otherwise.</p>
+
<div class="example">
- <p>If a document contains four style sheet links labeled as
- follows:</p>
+ <p>If a document contains style sheet links labeled as follows:</p>
<pre><link rel="stylesheet" href="A" type="text/plain">
<link rel="stylesheet" href="B" type="text/css">
@@ -31802,7 +31825,7 @@
<p>User agents must ignore any rows for image types that they do not
support.</p>
- <p>Otherwise, the <i>sniffed type</i> of the resource is the same as
+ <p>Otherwise, the sniffed type of the resource is the same as
its <var title="">official type</var>.</p>
More information about the Commit-Watchers
mailing list