|
332 | 332 | <dd><code>nonce</code> — Cryptographic nonce used in Content Security Policy checks [[CSP3]]</dd>
|
333 | 333 | <dd><code>hreflang</code> — Language of the linked resource</dd>
|
334 | 334 | <dd><code>type</code> — Hint for the type of the referenced resource</dd>
|
| 335 | + <dd><code>referrerpolicy</code> - <a>Referrer policy</a> for <a>fetches</a> initiated by the element</dd> |
335 | 336 | <dd><code>sizes</code> — Sizes of the icons (for <{link/rel}>="<code>icon</code>")</dd>
|
336 | 337 | <dd>
|
337 | 338 | Also, the <{link/title}> attribute has special semantics on this element: Title of the
|
|
357 | 358 | [CEReactions] attribute DOMString hreflang;
|
358 | 359 | [CEReactions] attribute DOMString type;
|
359 | 360 | [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList sizes;
|
360 |
| - }; |
| 361 | + [CEReactions] attribute DOMString referrerPolicy; |
| 362 | + }; |
361 | 363 | HTMLLinkElement implements LinkStyle;
|
362 | 364 | </pre>
|
363 | 365 | </dd>
|
|
463 | 465 | For <a>external resource links</a>, the <{link/type}> attribute is used as a hint to user agents
|
464 | 466 | so that they can avoid fetching resources they do not support.
|
465 | 467 |
|
466 |
| - <!-- def <{link/referrerpolicy}> --> |
| 468 | + The <dfn element-attr for="link"><code>referrerpolicy</code></dfn> attribute is a |
| 469 | + <a>referrer policy attribute</a>. It is intended for use with <a>external resource links</a>, |
| 470 | + where it helps set the <a>referrer policy</a> used when <a>obtaining</a> the external resource. |
| 471 | + [[!REFERRERPOLICY]]. |
467 | 472 |
|
468 | 473 | The <dfn element-attr for="link"><code>title</code></dfn> attribute gives the title of the link.
|
469 | 474 | With one exception, it is purely advisory. The value is text. The exception is for style sheet
|
|
525 | 530 |
|
526 | 531 | <!-- def {{HTMLLinkElement/referrerPolicy}} -->
|
527 | 532 |
|
| 533 | + The <dfn attribute for="HTMLLinkElement"><code>referrerPolicy</code></dfn> IDL attribute must |
| 534 | + <a>reflect</a> the <code>referrerpolicy</code> |
| 535 | + content attribute, <a>limited to only known values</a>. |
| 536 | + |
528 | 537 | The IDL attribute <dfn attribute for="HTMLLinkElement"><code>relList</code></dfn> must
|
529 | 538 | <a>reflect</a> the <{link/rel}> content attribute.
|
530 | 539 |
|
|
630 | 639 | {{Window}} object's <a>environment settings object</a>.
|
631 | 640 | 6. Set <var>request</var>'s <a>cryptographic nonce metadata</a> to the current state of the
|
632 | 641 | <{link}> element's <{link/nonce}> content attribute.
|
633 |
| - 7. <a>Fetch</a> <var>request</var>. |
| 642 | + 7. Set <var>request</var>'s <a>referrer policy</a> to the current state of the |
| 643 | + <{link}> element's <{link/referrerpolicy}> content attribute. |
| 644 | + 8. <a>Fetch</a> <var>request</var>. |
634 | 645 |
|
635 | 646 | User agents may opt to only try to obtain such resources when they are needed, instead of
|
636 | 647 | pro-actively fetching all the external resources that are not applied.
|
|
963 | 974 | inappropriate keywords.
|
964 | 975 | </p>
|
965 | 976 |
|
| 977 | + : <dfn><code>referrer</code></dfn> |
| 978 | + |
| 979 | + :: The value must be a <a>referrer policy</a>, which defines the default |
| 980 | + <a>referrer policy</a> for the <code>Document</code>. [[!REFERRERPOLICY]] |
| 981 | + |
| 982 | + If any <code>meta</code> elements are <a>inserted into the document</a> or |
| 983 | + <a>removed from the document</a>, or existing <code>meta</code> elements have their <code>name</code> |
| 984 | + or <code>content</code> attributes changed, user agents must run the following algorithm: |
| 985 | + |
| 986 | + 1. <p>Let <var>candidate elements</var> be the list of all <code>meta</code> elements that |
| 987 | + meet the following criteria, in <a>tree order</a>:</p> |
| 988 | + |
| 989 | + <ul class="brief"> |
| 990 | + <li>The element is <a>in a document tree</a></li> |
| 991 | + <li>The element has a <code>name</code> attribute, whose value is <code>referrer</code></li> |
| 992 | + <li>The element has a <code>content</code> attribute, whose value is not the empty string</li> |
| 993 | + <li>The element is a child of the <{head}> element of the document</li> |
| 994 | + </ul> |
| 995 | + |
| 996 | + 2. For each <var>element</var> in <var>candidate elements</var>: |
| 997 | + |
| 998 | + 1. <p>Let <var>value</var> be the value of <var>element</var>'s <code>content</code> attribute, |
| 999 | + converted to [=ASCII lowercase=].</p></li> |
| 1000 | + |
| 1001 | + 2. <p>If <var>value</var> is one of the values given in the first column of the following |
| 1002 | + table, then set <var>value</var> to the value given in the second column:</p> |
| 1003 | + |
| 1004 | + <table> |
| 1005 | + <thead> |
| 1006 | + <tr> |
| 1007 | + <th>Legacy value |
| 1008 | + <th>Referrer policy |
| 1009 | + <tbody> |
| 1010 | + <tr> |
| 1011 | + <td><code>never</code> |
| 1012 | + <td><code>no-referrer</code> |
| 1013 | + <tr> |
| 1014 | + <td><code>default</code> |
| 1015 | + <td><code>no-referrer-when-downgrade</code> |
| 1016 | + <tr> |
| 1017 | + <td><code>always</code> |
| 1018 | + <td><code>unsafe-url</code> |
| 1019 | + <tr> |
| 1020 | + <td><code>origin-when-crossorigin</code> |
| 1021 | + <td><code>origin-when-cross-origin</code> |
| 1022 | + </table> |
| 1023 | + |
| 1024 | + 3. <p>If <var>value</var> is a <a>referrer policy</a>, then set <var>element</var>'s |
| 1025 | + <a>node document</a>'s <a>referrer policy</a> to <var>policy</var>.</p> |
| 1026 | + |
| 1027 | + |
| 1028 | + <p class="note">The fact that these steps are applied for each element enables <a |
| 1029 | + href="https://w3c.github.io/webappsec-referrer-policy/#unknown-policy-values">deployment of |
| 1030 | + fallback values for older user agents</a>. [[!REFERRERPOLICY]]</p> |
| 1031 | + |
| 1032 | + </div> |
| 1033 | + |
966 | 1034 | <h5 id="other-metadata-names">Other metadata names</h5>
|
967 | 1035 |
|
968 | 1036 | <dfn lt="register the names|register the name|metadata names">Extensions to the predefined set of metadata names</dfn> may be registered in the
|
|
0 commit comments