Permalink
Browse files

change `require-sri-for` parsing algorithm

Initialize protected resource type set as empty, not null.
  • Loading branch information...
1 parent 240e1c9 commit 5c05e064ee3901dad20a573dc4ea54e9bbdad306 @shekyan shekyan committed May 10, 2016
Showing with 99 additions and 47 deletions.
  1. +2 −2 index.bikeshed.bs
  2. +97 −45 index.bikeshed.html
View
@@ -356,7 +356,7 @@ only to simplify the algorithm description.
## Request verification algorithms ## {#request-verification-algorithms}
-### Opting-in
+### Opting-in {#opt-in-require-sri-for}
Authors may opt a Document to require SRI metadata be present for
some resource types via a <dfn export>require-sri-for</dfn> <a>Content
@@ -376,7 +376,7 @@ The directive recognizes a number of potential token values:
To parse the |token| list, the user agent MUST use an algorithm equivalent to the following:
-1. Let the set of |protected resource types| that require SRI be |null|.
+1. Let the set of |protected resource types| that require SRI be the empty set.
2. For each token returned by <a>splitting tokens on spaces</a>,
if token matches the grammar for <a>require-sri-for</a>,
View
@@ -296,36 +296,43 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<li><a href="#priority"><span class="secno">3.2.2</span> <span class="content">Priority</span></a>
</ol>
<li>
- <a href="#verification-algorithms"><span class="secno">3.3</span> <span class="content">Response verification algorithms</span></a>
+ <a href="#request-verification-algorithms"><span class="secno">3.3</span> <span class="content">Request verification algorithms</span></a>
<ol class="toc">
- <li><a href="#apply-algorithm-to-response"><span class="secno">3.3.1</span> <span class="content">Apply <var>algorithm</var> to <var>response</var></span></a>
- <li><a href="#is-response-eligible"><span class="secno">3.3.2</span> <span class="content">Is <var>response</var> eligible for integrity validation?</span></a>
- <li><a href="#parse-metadata"><span class="secno">3.3.3</span> <span class="content">Parse <var>metadata</var></span></a>
- <li><a href="#get-the-strongest-metadata"><span class="secno">3.3.4</span> <span class="content">Get the strongest metadata from <var>set</var></span></a>
- <li><a href="#does-response-match-metadatalist"><span class="secno">3.3.5</span> <span class="content">Does <var>response</var> match <var>metadataList</var>?</span></a>
+ <li><a href="#opt-in-require-sri-for"><span class="secno">3.3.1</span> <span class="content">Opting-in {#opt-in-require-sri-for}</span></a>
+ <li><a href="#parse-require-sri-for"><span class="secno">3.3.2</span> <span class="content">Parsing <code>require-sri-for</code></span></a>
+ <li><a href="#apply-algorithm-to-request"><span class="secno">3.3.3</span> <span class="content">Apply <var>algorithm</var> to <var>request</var></span></a>
</ol>
- <li><a href="#verification-of-html-document-subresources"><span class="secno">3.4</span> <span class="content">Verification of HTML document subresources</span></a>
- <li><a href="#the-integrity-attribute"><span class="secno">3.5</span> <span class="content">The <code>integrity</code> attribute</span></a>
<li>
- <a href="#interface-extensions"><span class="secno">3.6</span> <span class="content">Element interface extensions</span></a>
+ <a href="#response-verification-algorithms"><span class="secno">3.4</span> <span class="content">Response verification algorithms</span></a>
+ <ol class="toc">
+ <li><a href="#apply-algorithm-to-response"><span class="secno">3.4.1</span> <span class="content">Apply <var>algorithm</var> to <var>response</var></span></a>
+ <li><a href="#is-response-eligible"><span class="secno">3.4.2</span> <span class="content">Is <var>response</var> eligible for integrity validation?</span></a>
+ <li><a href="#parse-metadata"><span class="secno">3.4.3</span> <span class="content">Parse <var>metadata</var></span></a>
+ <li><a href="#get-the-strongest-metadata"><span class="secno">3.4.4</span> <span class="content">Get the strongest metadata from <var>set</var></span></a>
+ <li><a href="#does-response-match-metadatalist"><span class="secno">3.4.5</span> <span class="content">Does <var>response</var> match <var>metadataList</var>?</span></a>
+ </ol>
+ <li><a href="#verification-of-html-document-subresources"><span class="secno">3.5</span> <span class="content">Verification of HTML document subresources</span></a>
+ <li><a href="#the-integrity-attribute"><span class="secno">3.6</span> <span class="content">The <code>integrity</code> attribute</span></a>
+ <li>
+ <a href="#interface-extensions"><span class="secno">3.7</span> <span class="content">Element interface extensions</span></a>
<ol class="toc">
<li>
- <a href="#HTMLLinkElement"><span class="secno">3.6.1</span> <span class="content">HTMLLinkElement</span></a>
+ <a href="#HTMLLinkElement"><span class="secno">3.7.1</span> <span class="content">HTMLLinkElement</span></a>
<ol class="toc">
- <li><a href="#HTMLLinkElement-Attributes"><span class="secno">3.6.1.1</span> <span class="content">Attributes</span></a>
+ <li><a href="#HTMLLinkElement-Attributes"><span class="secno">3.7.1.1</span> <span class="content">Attributes</span></a>
</ol>
<li>
- <a href="#HTMLScriptElement"><span class="secno">3.6.2</span> <span class="content">HTMLScriptElement</span></a>
+ <a href="#HTMLScriptElement"><span class="secno">3.7.2</span> <span class="content">HTMLScriptElement</span></a>
<ol class="toc">
- <li><a href="#HTMLScriptElement-Attributes"><span class="secno">3.6.2.1</span> <span class="content">Attributes</span></a>
+ <li><a href="#HTMLScriptElement-Attributes"><span class="secno">3.7.2.1</span> <span class="content">Attributes</span></a>
</ol>
</ol>
- <li><a href="#handling-integrity-violations"><span class="secno">3.7</span> <span class="content">Handling integrity violations</span></a>
+ <li><a href="#handling-integrity-violations"><span class="secno">3.8</span> <span class="content">Handling integrity violations</span></a>
<li>
- <a href="#elements"><span class="secno">3.8</span> <span class="content">Elements</span></a>
+ <a href="#elements"><span class="secno">3.9</span> <span class="content">Elements</span></a>
<ol class="toc">
- <li><a href="#link-element-for-stylesheets"><span class="secno">3.8.1</span> <span class="content">The <code>link</code> element for stylesheets</span></a>
- <li><a href="#script-element"><span class="secno">3.8.2</span> <span class="content">The <code>script</code> element</span></a>
+ <li><a href="#link-element-for-stylesheets"><span class="secno">3.9.1</span> <span class="content">The <code>link</code> element for stylesheets</span></a>
+ <li><a href="#script-element"><span class="secno">3.9.2</span> <span class="content">The <code>script</code> element</span></a>
</ol>
</ol>
<li><a href="#proxies"><span class="secno">4</span> <span class="content">Proxies</span></a>
@@ -527,14 +534,14 @@ <h4 class="heading settled" data-level="3.2.1" id="agility"><span class="secno">
</div>
<p>In this case, the user agent will choose the strongest hash function in the
list, and use that metadata to validate the response (as described below in
-the <a href="#parse-metadata">§3.3.3 Parse metadata</a> and <a href="#get-the-strongest-metadata">§3.3.4 Get the strongest metadata from set</a> algorithms).</p>
+the <a href="#parse-metadata">§3.4.3 Parse metadata</a> and <a href="#get-the-strongest-metadata">§3.4.4 Get the strongest metadata from set</a> algorithms).</p>
<p>When a hash function is determined to be insecure, user agents SHOULD deprecate
and eventually remove support for integrity validation using the insecure hash
function. User agents MAY check the validity of responses using a digest based on
a deprecated function.</p>
<p>To allow authors to switch to stronger hash functions without being held back by older
user agents, validation using unsupported hash functions acts like no integrity value
-was provided (see the <a href="#does-response-match-metadatalist">§3.3.5 Does response match metadataList?</a> algorithm below).
+was provided (see the <a href="#does-response-match-metadatalist">§3.4.5 Does response match metadataList?</a> algorithm below).
Authors are encouraged to use strong hash functions, and to begin migrating to
stronger hash functions as they become available.</p>
<h4 class="heading settled" data-level="3.2.2" id="priority"><span class="secno">3.2.2. </span><span class="content">Priority</span><a class="self-link" href="#priority"></a></h4>
@@ -549,11 +556,49 @@ <h4 class="heading settled" data-level="3.2.2" id="priority"><span class="secno"
implementation detail. It is not an API that implementors
provide to web applications. It is used in this document
only to simplify the algorithm description.</p>
- <h3 class="heading settled" data-level="3.3" id="verification-algorithms"><span class="secno">3.3. </span><span class="content">Response verification algorithms</span><a class="self-link" href="#verification-algorithms"></a></h3>
- <h4 class="heading settled" data-level="3.3.1" id="apply-algorithm-to-response"><span class="secno">3.3.1. </span><span class="content">Apply <var>algorithm</var> to <var>response</var></span><a class="self-link" href="#apply-algorithm-to-response"></a></h4>
+ <h3 class="heading settled" data-level="3.3" id="request-verification-algorithms"><span class="secno">3.3. </span><span class="content">Request verification algorithms</span><a class="self-link" href="#request-verification-algorithms"></a></h3>
+ <h4 class="heading settled" data-level="3.3.1" id="opt-in-require-sri-for"><span class="secno">3.3.1. </span><span class="content">Opting-in {#opt-in-require-sri-for}</span><a class="self-link" href="#opt-in-require-sri-for"></a></h4>
+ <p>Authors may opt a Document to require SRI metadata be present for
+some resource types via a <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-lt="require-sri-for" id="require-sri-for">require-sri-for<span class="dfn-panel" data-deco=""><b><a href="#require-sri-for">#require-sri-for</a></b><b>Referenced in:</b><span><a href="#ref-for-require-sri-for-1">3.3.2. Parsing require-sri-for</a></span></span></dfn> <a data-link-type="dfn" href="https://www.w3.org/TR/CSP/#content-security-policy">Content
+Security Policy</a> directive defined by the following ABNF grammar:</p>
+<pre>directive-name = "require-sri-for"
+directive-value = <a data-link-type="grammar" href="https://tools.ietf.org/html/rfc7230#section-3.2.6">token</a> *( <a data-link-type="grammar" href="https://tools.ietf.org/html/rfc7230#section-3.2.3">RWS</a> <a data-link-type="grammar" href="https://tools.ietf.org/html/rfc7230#section-3.2.6">token</a> )
+</pre>
+ <p>The directive recognizes a number of potential token values:</p>
+ <ul>
+ <li data-md="">
+ <p><code>script</code> requires SRI for scripts</p>
+ <li data-md="">
+ <p><code>style</code> requires SRI for style sheets</p>
+ </ul>
+ <h4 class="heading settled" data-level="3.3.2" id="parse-require-sri-for"><span class="secno">3.3.2. </span><span class="content">Parsing <code>require-sri-for</code></span><a class="self-link" href="#parse-require-sri-for"></a></h4>
+ <p>To parse the <var>token</var> list, the user agent MUST use an algorithm equivalent to the following:</p>
+ <ol>
+ <li data-md="">
+ <p>Let the set of <var>protected resource types</var> that require SRI be the empty set.</p>
+ <li data-md="">
+ <p>For each token returned by <a data-link-type="dfn" href="http://www.w3.org/TR/html5/scripting-1.html#split-a-string-on-spaces">splitting tokens on spaces</a>,
+if token matches the grammar for <a data-link-type="dfn" href="#require-sri-for" id="ref-for-require-sri-for-1">require-sri-for</a>,
+add the token to the set of <var>protected resource types</var>. Otherwise, ignore the token.</p>
+ <li data-md="">
+ <p>Return the set of <var>protected resource types</var>.</p>
+ </ol>
+ <h4 class="heading settled" data-level="3.3.3" id="apply-algorithm-to-request"><span class="secno">3.3.3. </span><span class="content">Apply <var>algorithm</var> to <var>request</var></span><a class="self-link" href="#apply-algorithm-to-request"></a></h4>
+ <ol>
+ <li data-md="">
+ <p>Let <var>protected resource types</var> be the result of <a href="#parse-require-sri-for">§3.3.2 Parsing require-sri-for</a>.</p>
+ <li data-md="">
+ <p>If <var>request</var>’s type is a <a data-link-type="dfn" href="http://www.w3.org/TR/html5/scripting-1.html#ascii-case-insensitive">ASCII case-insensitive match</a> for at least
+one token in <var>protected resource types</var>, and <var>request</var>’s integrity metadata
+is the empty string, return "Blocked":</p>
+ <li data-md="">
+ <p>Return "Allowed".</p>
+ </ol>
+ <h3 class="heading settled" data-level="3.4" id="response-verification-algorithms"><span class="secno">3.4. </span><span class="content">Response verification algorithms</span><a class="self-link" href="#response-verification-algorithms"></a></h3>
+ <h4 class="heading settled" data-level="3.4.1" id="apply-algorithm-to-response"><span class="secno">3.4.1. </span><span class="content">Apply <var>algorithm</var> to <var>response</var></span><a class="self-link" href="#apply-algorithm-to-response"></a></h4>
<ol>
<li data-md="">
- <p>Let <var>result</var> be the result of <a href="#apply-algorithm-to-response">§3.3.1 Apply algorithm to response</a> to the <a data-link-type="dfn" href="#representation-data" id="ref-for-representation-data-1">representation data</a> without any content-codings
+ <p>Let <var>result</var> be the result of <a href="#apply-algorithm-to-response">§3.4.1 Apply algorithm to response</a> to the <a data-link-type="dfn" href="#representation-data" id="ref-for-representation-data-1">representation data</a> without any content-codings
applied, except when the user agent intends to consume the content with
content-encodings applied. In the latter case, let <var>result</var> be
the result of applying <var>algorithm</var> to the <a data-link-type="dfn" href="#representation-data" id="ref-for-representation-data-2">representation data</a>.</p>
@@ -562,7 +607,7 @@ <h4 class="heading settled" data-level="3.3.1" id="apply-algorithm-to-response">
<li data-md="">
<p>Return <var>encodedResult</var>.</p>
</ol>
- <h4 class="heading settled" data-level="3.3.2" id="is-response-eligible"><span class="secno">3.3.2. </span><span class="content">Is <var>response</var> eligible for integrity validation?</span><a class="self-link" href="#is-response-eligible"></a></h4>
+ <h4 class="heading settled" data-level="3.4.2" id="is-response-eligible"><span class="secno">3.4.2. </span><span class="content">Is <var>response</var> eligible for integrity validation?</span><a class="self-link" href="#is-response-eligible"></a></h4>
<p>In order to mitigate an attacker’s ability to read data cross-origin by
brute-forcing values via integrity checks, responses are only eligible for such
checks if they are same-origin or are the result of explicit access granted to
@@ -634,7 +679,7 @@ <h4 class="heading settled" data-level="3.3.3" id="parse-metadata"><span class="
<li data-md="">
<p>Return <code>no metadata</code> if <var>empty</var> is <code>true</code>, otherwise return <var>result</var>.</p>
</ol>
- <h4 class="heading settled" data-level="3.3.4" id="get-the-strongest-metadata"><span class="secno">3.3.4. </span><span class="content">Get the strongest metadata from <var>set</var></span><a class="self-link" href="#get-the-strongest-metadata"></a></h4>
+ <h4 class="heading settled" data-level="3.4.4" id="get-the-strongest-metadata"><span class="secno">3.4.4. </span><span class="content">Get the strongest metadata from <var>set</var></span><a class="self-link" href="#get-the-strongest-metadata"></a></h4>
<ol>
<li data-md="">
<p>Let <var>result</var> be the empty set and <var>strongest</var> be the empty
@@ -656,7 +701,7 @@ <h4 class="heading settled" data-level="3.3.4" id="get-the-strongest-metadata"><
<li data-md="">
<p>Return <var>result</var>.</p>
</ol>
- <h4 class="heading settled" data-level="3.3.5" id="does-response-match-metadatalist"><span class="secno">3.3.5. </span><span class="content">Does <var>response</var> match <var>metadataList</var>?</span><a class="self-link" href="#does-response-match-metadatalist"></a></h4>
+ <h4 class="heading settled" data-level="3.4.5" id="does-response-match-metadatalist"><span class="secno">3.4.5. </span><span class="content">Does <var>response</var> match <var>metadataList</var>?</span><a class="self-link" href="#does-response-match-metadatalist"></a></h4>
<ol>
<li data-md="">
<p>Let <var>parsedMetadata</var> be the result of
@@ -707,7 +752,7 @@ <h4 class="heading settled" data-level="3.3.5" id="does-response-match-metadatal
validation since Subresource Integrity requires CORS, and it is a logical error
to attempt to use it without CORS. Additionally, user agents SHOULD report a
warning message to the developer console to explain this failure.</p>
- <h3 class="heading settled" data-level="3.4" id="verification-of-html-document-subresources"><span class="secno">3.4. </span><span class="content">Verification of HTML document subresources</span><a class="self-link" href="#verification-of-html-document-subresources"></a></h3>
+ <h3 class="heading settled" data-level="3.5" id="verification-of-html-document-subresources"><span class="secno">3.5. </span><span class="content">Verification of HTML document subresources</span><a class="self-link" href="#verification-of-html-document-subresources"></a></h3>
<p>A variety of HTML elements result in requests for resources that are to be
embedded into the document, or executed in its context. To support integrity
metadata for some of these elements, a new <code>integrity</code> attribute is added to
@@ -716,7 +761,7 @@ <h3 class="heading settled" data-level="3.4" id="verification-of-html-document-s
value each element’s <code>integrity</code> content attribute is added to the <code>HTMLLinkElement</code> and <code>HTMLScriptElement</code> interfaces.</p>
<p class="note" role="note">Note: A future revision of this specification is likely to include integrity support
for all possible subresources, i.e., <code>a</code>, <code>audio</code>, <code>embed</code>, <code>iframe</code>, <code>img</code>, <code>link</code>, <code>object</code>, <code>script</code>, <code>source</code>, <code>track</code>, and <code>video</code> elements.</p>
- <h3 class="heading settled" data-level="3.5" id="the-integrity-attribute"><span class="secno">3.5. </span><span class="content">The <code>integrity</code> attribute</span><a class="self-link" href="#the-integrity-attribute"></a></h3>
+ <h3 class="heading settled" data-level="3.6" id="the-integrity-attribute"><span class="secno">3.6. </span><span class="content">The <code>integrity</code> attribute</span><a class="self-link" href="#the-integrity-attribute"></a></h3>
<p>The <code>integrity</code> attribute represents <a data-link-type="dfn" href="#integrity-metadata" id="ref-for-integrity-metadata-7">integrity metadata</a> for an element.
The value of the attribute MUST be either the empty string, or at least one
valid metadata as described by the following ABNF grammar:</p>
@@ -736,40 +781,40 @@ <h3 class="heading settled" data-level="3.5" id="the-integrity-attribute"><span
no options have been defined. It is likely that a future version of the spec
will define a more specific syntax for options, so it is defined here as broadly
as possible.</p>
- <h3 class="heading settled" data-level="3.6" id="interface-extensions"><span class="secno">3.6. </span><span class="content">Element interface extensions</span><a class="self-link" href="#interface-extensions"></a></h3>
- <h4 class="heading settled" data-level="3.6.1" id="HTMLLinkElement"><span class="secno">3.6.1. </span><span class="content">HTMLLinkElement</span><a class="self-link" href="#HTMLLinkElement"></a></h4>
+ <h3 class="heading settled" data-level="3.7" id="interface-extensions"><span class="secno">3.7. </span><span class="content">Element interface extensions</span><a class="self-link" href="#interface-extensions"></a></h3>
+ <h4 class="heading settled" data-level="3.7.1" id="HTMLLinkElement"><span class="secno">3.7.1. </span><span class="content">HTMLLinkElement</span><a class="self-link" href="#HTMLLinkElement"></a></h4>
<pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/semantics.html#htmllinkelement">HTMLLinkElement</a> {
attribute DOMString <dfn class="idl-code" data-dfn-for="HTMLLinkElement" data-dfn-type="attribute" data-export="" data-type="DOMString" id="dom-htmllinkelement-integrity">integrity<a class="self-link" href="#dom-htmllinkelement-integrity"></a></dfn>;
};
</pre>
- <h5 class="heading settled" data-level="3.6.1.1" id="HTMLLinkElement-Attributes"><span class="secno">3.6.1.1. </span><span class="content">Attributes</span><a class="self-link" href="#HTMLLinkElement-Attributes"></a></h5>
+ <h5 class="heading settled" data-level="3.7.1.1" id="HTMLLinkElement-Attributes"><span class="secno">3.7.1.1. </span><span class="content">Attributes</span><a class="self-link" href="#HTMLLinkElement-Attributes"></a></h5>
<b>integrity</b> of type <code>DOMString</code>: The value of this element’s integrity
attribute.
- <h4 class="heading settled" data-level="3.6.2" id="HTMLScriptElement"><span class="secno">3.6.2. </span><span class="content">HTMLScriptElement</span><a class="self-link" href="#HTMLScriptElement"></a></h4>
+ <h4 class="heading settled" data-level="3.7.2" id="HTMLScriptElement"><span class="secno">3.7.2. </span><span class="content">HTMLScriptElement</span><a class="self-link" href="#HTMLScriptElement"></a></h4>
<pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/scripting.html#htmlscriptelement">HTMLScriptElement</a> {
attribute DOMString <dfn class="idl-code" data-dfn-for="HTMLScriptElement" data-dfn-type="attribute" data-export="" data-type="DOMString" id="dom-htmlscriptelement-integrity">integrity<a class="self-link" href="#dom-htmlscriptelement-integrity"></a></dfn>;
};
</pre>
- <h5 class="heading settled" data-level="3.6.2.1" id="HTMLScriptElement-Attributes"><span class="secno">3.6.2.1. </span><span class="content">Attributes</span><a class="self-link" href="#HTMLScriptElement-Attributes"></a></h5>
+ <h5 class="heading settled" data-level="3.7.2.1" id="HTMLScriptElement-Attributes"><span class="secno">3.7.2.1. </span><span class="content">Attributes</span><a class="self-link" href="#HTMLScriptElement-Attributes"></a></h5>
<b>integrity</b> of type <code>DOMString</code>: The value of this element’s integrity
attribute.
- <h3 class="heading settled" data-level="3.7" id="handling-integrity-violations"><span class="secno">3.7. </span><span class="content">Handling integrity violations</span><a class="self-link" href="#handling-integrity-violations"></a></h3>
+ <h3 class="heading settled" data-level="3.8" id="handling-integrity-violations"><span class="secno">3.8. </span><span class="content">Handling integrity violations</span><a class="self-link" href="#handling-integrity-violations"></a></h3>
<p>The user agent will refuse to render or execute responses that fail an integrity
check, instead returning a network error as defined in Fetch <a data-link-type="biblio" href="#biblio-fetch">[FETCH]</a>.</p>
<p class="note" role="note">Note: On a failed integrity check, an <code>error</code> event is fired. Developers
wishing to provide a canonical fallback resource (e.g., a resource not served
from a CDN, perhaps from a secondary, trusted, but slower source) can catch this <code>error</code> event and provide an appropriate handler to replace the
failed resource with a different one.</p>
- <h3 class="heading settled" data-level="3.8" id="elements"><span class="secno">3.8. </span><span class="content">Elements</span><a class="self-link" href="#elements"></a></h3>
- <h4 class="heading settled" data-level="3.8.1" id="link-element-for-stylesheets"><span class="secno">3.8.1. </span><span class="content">The <code>link</code> element for stylesheets</span><a class="self-link" href="#link-element-for-stylesheets"></a></h4>
+ <h3 class="heading settled" data-level="3.9" id="elements"><span class="secno">3.9. </span><span class="content">Elements</span><a class="self-link" href="#elements"></a></h3>
+ <h4 class="heading settled" data-level="3.9.1" id="link-element-for-stylesheets"><span class="secno">3.9.1. </span><span class="content">The <code>link</code> element for stylesheets</span><a class="self-link" href="#link-element-for-stylesheets"></a></h4>
<p>Whenever a user agent attempts to <a data-link-type="dfn" href="http://www.w3.org/TR/html5/document-metadata.html#concept-link-obtain">obtain a resource</a> pointed to by a <code>link</code> element that has a <code>rel</code> attribute with the keyword of <code>stylesheet</code>,
modify step 4 to read:</p>
<p>Do a potentially CORS-enabled fetch of the resulting absolute URL, with the
mode being the current state of the element’s crossorigin content attribute,
the origin being the origin of the link element’s Document, the default origin
behavior set to taint, and the <a data-link-type="dfn" href="#integrity-metadata" id="ref-for-integrity-metadata-8">integrity metadata</a> of the request set to
the value of the element’s <code>integrity</code> attribute.</p>
- <h4 class="heading settled" data-level="3.8.2" id="script-element"><span class="secno">3.8.2. </span><span class="content">The <code>script</code> element</span><a class="self-link" href="#script-element"></a></h4>
+ <h4 class="heading settled" data-level="3.9.2" id="script-element"><span class="secno">3.9.2. </span><span class="content">The <code>script</code> element</span><a class="self-link" href="#script-element"></a></h4>
<p>Replace step 14.1 of HTML5’s <a data-link-type="dfn" href="http://www.w3.org/TR/html5/scripting-1.html#prepare-a-script">prepare a script</a> algorithm with:</p>
<ol>
<li data-md="">
@@ -872,26 +917,27 @@ <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
<ul class="index">
<li><a href="#base64-encoding">base64 encoding</a><span>, in §2</span>
- <li><a href="#grammardef-base64-value">base64-value</a><span>, in §3.5</span>
+ <li><a href="#grammardef-base64-value">base64-value</a><span>, in §3.6</span>
<li><a href="#content-encoding">content encoding</a><span>, in §2</span>
<li><a href="#cross-origin">cross-origin</a><span>, in §2</span>
<li><a href="#digest">digest</a><span>, in §2</span>
<li><a href="#getprioritizedhashfunction">getPrioritizedHashFunction</a><span>, in §3.2.2</span>
- <li><a href="#grammardef-hash-algo">hash-algo</a><span>, in §3.5</span>
- <li><a href="#grammardef-hash-expression">hash-expression</a><span>, in §3.5</span>
- <li><a href="#grammardef-hash-with-options">hash-with-options</a><span>, in §3.5</span>
+ <li><a href="#grammardef-hash-algo">hash-algo</a><span>, in §3.6</span>
+ <li><a href="#grammardef-hash-expression">hash-expression</a><span>, in §3.6</span>
+ <li><a href="#grammardef-hash-with-options">hash-with-options</a><span>, in §3.6</span>
<li>
integrity
<ul>
- <li><a href="#dom-htmllinkelement-integrity">attribute for HTMLLinkElement</a><span>, in §3.6.1</span>
- <li><a href="#dom-htmlscriptelement-integrity">attribute for HTMLScriptElement</a><span>, in §3.6.2</span>
+ <li><a href="#dom-htmllinkelement-integrity">attribute for HTMLLinkElement</a><span>, in §3.7.1</span>
+ <li><a href="#dom-htmlscriptelement-integrity">attribute for HTMLScriptElement</a><span>, in §3.7.2</span>
</ul>
- <li><a href="#grammardef-integrity-metadata">integrity-metadata</a><span>, in §3.5</span>
+ <li><a href="#grammardef-integrity-metadata">integrity-metadata</a><span>, in §3.6</span>
<li><a href="#integrity-metadata">integrity
metadata</a><span>, in §3.1</span>
- <li><a href="#grammardef-option-expression">option-expression</a><span>, in §3.5</span>
+ <li><a href="#grammardef-option-expression">option-expression</a><span>, in §3.6</span>
<li><a href="#origin">origin</a><span>, in §2</span>
<li><a href="#representation-data">representation data</a><span>, in §2</span>
+ <li><a href="#require-sri-for">require-sri-for</a><span>, in §3.3.1</span>
<li><a href="#same-origin">same-origin</a><span>, in §2</span>
</ul>
<h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
@@ -912,11 +958,13 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
<li>
<a data-link-type="biblio">[HTML5]</a> defines the following terms:
<ul>
+ <li><a href="http://www.w3.org/TR/html5/scripting-1.html#ascii-case-insensitive">ascii case-insensitive match</a>
<li><a href="http://www.w3.org/TR/html5/infrastructure.html#cors-settings-attributes">cors settings attribute</a>
<li><a href="http://www.w3.org/TR/html5/document-metadata.html#concept-link-obtain">obtain a resource</a>
<li><a href="http://www.w3.org/TR/html5/scripting-1.html#prepare-a-script">prepare a script</a>
<li><a href="http://www.w3.org/TR/html5/infrastructure.html#reflect">reflect</a>
<li><a href="http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces">split on spaces</a>
+ <li><a href="http://www.w3.org/TR/html5/scripting-1.html#split-a-string-on-spaces">splitting tokens on spaces</a>
</ul>
<li>
<a data-link-type="biblio">[rfc7234]</a> defines the following terms:
@@ -951,12 +999,14 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
<dd>D. Crocker, Ed.; P. Overell. <a href="https://tools.ietf.org/html/rfc5234">Augmented BNF for Syntax Specifications: ABNF</a>. January 2008. Internet Standard. URL: <a href="https://tools.ietf.org/html/rfc5234">https://tools.ietf.org/html/rfc5234</a>
<dt id="biblio-cors">[CORS]
<dd>Anne van Kesteren. <a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a>. 16 January 2014. REC. URL: <a href="http://www.w3.org/TR/cors/">http://www.w3.org/TR/cors/</a>
+ <dt id="biblio-csp1">[CSP1]
+ <dd>Brandon Sterne; Adam Barth. <a href="http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-1.0-specification.html">Content Security Policy 1.0</a>. 19 February 2015. NOTE. URL: <a href="http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-1.0-specification.html">http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-1.0-specification.html</a>
<dt id="biblio-fetch">[FETCH]
<dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
<dt id="biblio-html">[HTML]
<dd>Ian Hickson. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
<dt id="biblio-html5">[HTML5]
- <dd>Ian Hickson; et al. <a href="http://www.w3.org/TR/html5/">HTML5</a>. 28 October 2014. REC. URL: <a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a>
+ <dd>Ian Hickson; et al. <a href="http://www.w3.org/html/wg/drafts/html/master/">HTML5</a>. 28 October 2014. REC. URL: <a href="http://www.w3.org/html/wg/drafts/html/master/">http://www.w3.org/html/wg/drafts/html/master/</a>
<dt id="biblio-mime-types">[MIME-TYPES]
<dd>N. Freed; N. Borenstein. <a href="https://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>. November 1996. Draft Standard. URL: <a href="https://tools.ietf.org/html/rfc2046">https://tools.ietf.org/html/rfc2046</a>
<dt id="biblio-origin">[ORIGIN]
@@ -965,6 +1015,8 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
<dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
<dt id="biblio-rfc4648">[RFC4648]
<dd>S. Josefsson. <a href="https://tools.ietf.org/html/rfc4648">The Base16, Base32, and Base64 Data Encodings</a>. October 2006. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc4648">https://tools.ietf.org/html/rfc4648</a>
+ <dt id="biblio-rfc7230">[RFC7230]
+ <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href="https://tools.ietf.org/html/rfc7230">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>. June 2014. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc7230">https://tools.ietf.org/html/rfc7230</a>
<dt id="biblio-rfc7231">[RFC7231]
<dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href="https://tools.ietf.org/html/rfc7231">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>. June 2014. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc7231">https://tools.ietf.org/html/rfc7231</a>
<dt id="biblio-rfc7234">[RFC7234]

0 comments on commit 5c05e06

Please sign in to comment.