Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Port nonce #604

Merged
merged 4 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sections/attributes.include
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
</tr>
<tr>
<th><code>nonce</code></th>
<td><{script}>; <{style}></td>
<td><{link}>; <{script}>; <{style}></td>
Copy link
Member

Choose a reason for hiding this comment

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

There are two indices in the WHATWG spec: one for attribute -> element, and one for the inverse. I don't know if the W3C doc follows that model.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, found it and added, thanks

<td>Cryptographic nonce used in <a>Content Security Policy</a> checks [[CSP3]]</td>
<td><a>Text</a></td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions sections/elements.include
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@
<{link/crossorigin}>;
<{link/rel}>;
<{link/media}>;
<{link/nonce}>;
<{link/hreflang}>;
<{link/type}>;
<{link/sizes}></td>
Expand Down
11 changes: 10 additions & 1 deletion sections/semantics-document-metadata.include
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
<dd><{link/rel}> — Relationship of this document (or subsection/topic) to the destination resource</dd>
<dd><{link/rev}> — <a>Reverse link</a> relationship of the destination resource to this document (or subsection/topic)</dd>
<dd><code>media</code> — Applicable media</dd>
<dd><code>nonce</code> — Cryptographic nonce used in Content Security Policy checks [[CSP3]]</dd>
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The leading whitespace here still seems incorrect.

Copy link

Choose a reason for hiding this comment

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

It'll render the same... noted, thanks

<dd><code>hreflang</code> — Language of the linked resource</dd>
<dd><code>type</code> — Hint for the type of the referenced resource</dd>
<dd><code>sizes</code> — Sizes of the icons (for <{link/rel}>="<code>icon</code>")</dd>
Expand Down Expand Up @@ -466,6 +467,11 @@
which indicates that the current document is the table of contents document for every chapter.

</div>

<p>The <dfn element-attr for="link"><code>nonce</code></dfn> attribute represents a
cryptographic nonce ("number used once") which can be used by <cite>Content Security Policy</cite>
to determine whether or not an external resource specified by the link will be loaded and applied
to the document. The value is text. [[CSP3]]</p>

The <dfn element-attr for="link"><code>crossorigin</code></dfn> attribute is a
<a>CORS settings attribute</a>. It is intended for use with external resource links.
Expand All @@ -490,7 +496,9 @@
<var>url</var> and <var>corsAttributeState</var>.
5. Set <var>request</var>'s <a>client</a> to the <{link}> element's <a>node document</a>'s
{{Window}} object's <a>environment settings object</a>.
6. <a>Fetch</a> <var>request</var>.
6. Set <var>request</var>'s <span>cryptographic
nonce metadata</span> to the current state of the <{link}> element's <{link/nonce}> content attribute.
7. <a>Fetch</a> <var>request</var>.

User agents may opt to only try to obtain such resources when they are needed, instead of
pro-actively fetching all the external resources that are not applied.
Expand Down Expand Up @@ -667,6 +675,7 @@
<dfn attribute for="HTMLLinkElement"><code>rel</code></dfn>,
<dfn attribute for="HTMLLinkElement"><code>rev</code></dfn>,
<dfn attribute for="HTMLLinkElement"><code>media</code></dfn>,
<dfn attribute for="HTMLLinkElement"><code>nonce</code></dfn>,
<dfn attribute for="HTMLLinkElement"><code>hreflang</code></dfn>,
<dfn attribute for="HTMLLinkElement"><code>type</code></dfn>, and
<dfn attribute for="HTMLLinkElement"><code>sizes</code></dfn> each must <a>reflect</a> the
Expand Down