Skip to content

Commit 0ea88cf

Browse files
authored
Document exactly what works with the Link header
This adds "has `Link` processing" to the link types table, which currently only has "Yes" values for preload and preconnect. Closes #4224, and removes the reference to it in the spec. That issue was about the general lack of specification for the Link header, which has been resolved. #8741 tracks potentially adding Link header support for rel=stylesheet, but there's no need to retain notices in the spec about the possibility of this nonstandard feature. (The note was also quite incomplete, as it didn't talk about things like the cascade, document.styleSheets, etc.)
1 parent f519475 commit 0ea88cf

File tree

1 file changed

+42
-23
lines changed

1 file changed

+42
-23
lines changed

source

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14980,12 +14980,9 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
1498014980
processing options</span>. This algorithm defines whether and how they react to appearing in an
1498114981
HTTP `<code data-x="http-link">Link</code>` response header.</p>
1498214982

14983-
<p class="XXX">The processing of `<code data-x="http-link">Link</code>` headers is not defined for
14984-
all link relation types. In particular some implementations might process types that have a no-op
14985-
<span>process link headers</span> algorithm, and in doing so influence a <code>Document</code>'s
14986-
<span>script-blocking style sheet counter</span>. See
14987-
<a href="https://github.com/whatwg/html/issues/4224">issue #4224</a> for discussion on
14988-
integrating this into the spec.</p>
14983+
<p class="note">For most link types, this algorithm does nothing. The <a
14984+
href="#table-link-relations">summary table</a> is a good reference to quickly know whether a link
14985+
type has defined <span>process a link header</span> steps.</p>
1498914986

1499014987
<p>A <dfn>link processing options</dfn> is a <span>struct</span>. It has the following
1499114988
<span data-x="struct item">items</span>:</p>
@@ -17038,8 +17035,8 @@ console.log(style.disabled); // false</code></pre>
1703817035
</ul>
1703917036

1704017037
<p class="XXX">It is expected that counterparts to the above rules also apply to
17041-
<code>&lt;?xml-stylesheet?></code> PIs and HTTP `<code data-x="http-link">Link</code>` headers.
17042-
However, this has not yet been thoroughly investigated.</p>
17038+
<code>&lt;?xml-stylesheet?></code> PIs. However, this has not yet been thoroughly
17039+
investigated.</p>
1704317040

1704417041
<p>A <code>Document</code> has a <dfn>script-blocking style sheet counter</dfn>, which is a
1704517042
number, initially 0.</p>
@@ -24869,12 +24866,13 @@ document.body.appendChild(wbr);</code></pre>
2486924866
<p>New link types that are to be implemented by web browsers are to be added to this standard. The
2487024867
remainder can be <span data-x="concept-rel-extensions">registered as extensions</span>.</p>
2487124868

24872-
<table class="yesno">
24869+
<table class="yesno" id="table-link-relations">
2487324870
<thead>
2487424871
<tr>
2487524872
<th rowspan="2">Link type</th>
2487624873
<th colspan="3">Effect on...</th>
2487724874
<th rowspan="2"><span>body-ok</span></th>
24875+
<th rowspan="2">Has `<code data-x="http-link">Link</code>` processing</th>
2487824876
<th rowspan="2">Brief description</th>
2487924877
</tr>
2488024878
<tr>
@@ -24886,18 +24884,20 @@ document.body.appendChild(wbr);</code></pre>
2488624884
<tbody>
2488724885

2488824886
<tr>
24889-
<td><code data-x="rel-alternate">alternate</code></td> <!-- fourth most used rel value -->
24887+
<td><code data-x="rel-alternate">alternate</code></td>
2489024888
<td colspan="2"><span>Hyperlink</span></td>
2489124889
<td><em>not allowed</em></td>
2489224890
<td class="no"> &middot; </td>
24891+
<td class="no"> &middot; </td>
2489324892
<td>Gives alternate representations of the current document.</td>
2489424893
</tr>
2489524894

2489624895
<tr>
24897-
<td><code data-x="rel-canonical">canonical</code></td> <!-- third most used rel value -->
24896+
<td><code data-x="rel-canonical">canonical</code></td>
2489824897
<td><span>Hyperlink</span></td>
2489924898
<td colspan="2"><em>not allowed</em></td>
2490024899
<td class="no"> &middot; </td>
24900+
<td class="no"> &middot; </td>
2490124901
<td>Gives the preferred URL for the current document.</td>
2490224902
</tr>
2490324903

@@ -24906,49 +24906,52 @@ document.body.appendChild(wbr);</code></pre>
2490624906
<td colspan="2"><span>Hyperlink</span></td>
2490724907
<td><em>not allowed</em></td>
2490824908
<td class="no"> &middot; </td>
24909+
<td class="no"> &middot; </td>
2490924910
<td>Gives a link to the author of the current document or article.</td>
2491024911
</tr>
2491124912

2491224913
<tr>
24913-
<td><code data-x="rel-bookmark">bookmark</code></td> <!-- fourth most used <a rel> value -->
24914+
<td><code data-x="rel-bookmark">bookmark</code></td>
2491424915
<td><em>not allowed</em></td>
2491524916
<td><span>Hyperlink</span></td>
2491624917
<td><em>not allowed</em></td>
2491724918
<td class="no"> &middot; </td>
24919+
<td class="no"> &middot; </td>
2491824920
<td>Gives the permalink for the nearest ancestor section.</td>
2491924921
</tr>
2492024922

24921-
<!-- <code data-x="rel-contact">contact</code></td> is not here because it's XFN (8th most used <a rel> value) -->
24922-
2492324923
<tr>
2492424924
<td><code data-x="rel-dns-prefetch">dns-prefetch</code></td>
2492524925
<td><span data-x="external resource link">External Resource</span></td>
2492624926
<td colspan="2"><em>not allowed</em></td>
2492724927
<td class="yes"> Yes </td>
24928+
<td class="no"> &middot; </td>
2492824929
<td>Specifies that the user agent should preemptively perform DNS resolution for the target resource's <span>origin</span>.</td>
2492924930
</tr>
2493024931

24931-
<!-- fifth and sixth most used <a rel> value (sixth is "external nofollow") -->
2493224932
<tr>
2493324933
<td><code data-x="rel-external">external</code></td>
2493424934
<td><em>not allowed</em></td>
2493524935
<td colspan="2"><span data-x="hyperlink annotation">Annotation</span></td>
2493624936
<td class="no"> &middot; </td>
24937+
<td class="no"> &middot; </td>
2493724938
<td>Indicates that the referenced document is not part of the same site as the current document.</td>
2493824939
</tr>
2493924940

2494024941
<tr>
2494124942
<td><code data-x="rel-help">help</code></td>
2494224943
<td colspan="3"><span>Hyperlink</span></td>
2494324944
<td class="no"> &middot; </td>
24945+
<td class="no"> &middot; </td>
2494424946
<td>Provides a link to context-sensitive help.</td>
2494524947
</tr>
2494624948

2494724949
<tr>
24948-
<td><code data-x="rel-icon">icon</code></td> <!-- second most used rel value -->
24950+
<td><code data-x="rel-icon">icon</code></td>
2494924951
<td><span data-x="external resource link">External Resource</span></td>
2495024952
<td colspan="2"><em>not allowed</em></td>
2495124953
<td class="no"> &middot; </td>
24954+
<td class="no"> &middot; </td>
2495224955
<td>Imports an icon to represent the current document.</td>
2495324956
</tr>
2495424957

@@ -24957,6 +24960,7 @@ document.body.appendChild(wbr);</code></pre>
2495724960
<td><span data-x="external resource link">External Resource</span></td>
2495824961
<td colspan="2"><em>not allowed</em></td>
2495924962
<td class="no"> &middot; </td>
24963+
<td class="no"> &middot; </td>
2496024964
<td>Imports or links to an <span>application manifest</span>. <ref spec=MANIFEST></td>
2496124965
</tr>
2496224966

@@ -24965,30 +24969,34 @@ document.body.appendChild(wbr);</code></pre>
2496524969
<td><span data-x="external resource link">External Resource</span></td>
2496624970
<td colspan="2"><em>not allowed</em></td>
2496724971
<td class="yes"> Yes </td>
24972+
<td class="no"> &middot; </td>
2496824973
<td>Specifies that the user agent must preemptively <span data-x="fetch a single module script">fetch the module
2496924974
script</span> and store it in the document's <span data-x="concept-document-module-map">module map</span> for later
2497024975
evaluation. Optionally, the module's dependencies can be fetched as well.</td>
2497124976
</tr>
2497224977

2497324978
<tr>
24974-
<td><code data-x="rel-license">license</code></td> <!-- seventh most used <a rel> value -->
24979+
<td><code data-x="rel-license">license</code></td>
2497524980
<td colspan="3"><span>Hyperlink</span></td>
2497624981
<td class="no"> &middot; </td>
24982+
<td class="no"> &middot; </td>
2497724983
<td>Indicates that the main content of the current document is covered by the copyright license described by the referenced document.</td>
2497824984
</tr>
2497924985

2498024986
<tr>
2498124987
<td><code data-x="rel-next">next</code></td>
2498224988
<td colspan="3"><span>Hyperlink</span></td>
2498324989
<td class="no"> &middot; </td>
24990+
<td class="no"> &middot; </td>
2498424991
<td>Indicates that the current document is a part of a series, and that the next document in the series is the referenced document.</td>
2498524992
</tr>
2498624993

2498724994
<tr>
24988-
<td><code data-x="rel-nofollow">nofollow</code></td> <!-- most used <a rel> value (and sixth most used is "external nofollow") -->
24995+
<td><code data-x="rel-nofollow">nofollow</code></td>
2498924996
<td><em>not allowed</em></td>
2499024997
<td colspan="2"><span data-x="hyperlink annotation">Annotation</span></td>
2499124998
<td class="no"> &middot; </td>
24999+
<td class="no"> &middot; </td>
2499225000
<td>Indicates that the current document's original author or publisher does not endorse the referenced document.</td>
2499325001
</tr>
2499425002

@@ -24997,6 +25005,7 @@ document.body.appendChild(wbr);</code></pre>
2499725005
<td><em>not allowed</em></td>
2499825006
<td colspan="2"><span data-x="hyperlink annotation">Annotation</span></td>
2499925007
<td class="no"> &middot; </td>
25008+
<td class="no"> &middot; </td>
2500025009
<td>Creates a <span>top-level traversable</span> with a non-<span>auxiliary browsing
2500125010
context</span> if the hyperlink would otherwise create one that was auxiliary (i.e., has an
2500225011
appropriate <code data-x="attr-hyperlink-target">target</code> attribute value).</td>
@@ -25007,6 +25016,7 @@ document.body.appendChild(wbr);</code></pre>
2500725016
<td><em>not allowed</em></td>
2500825017
<td colspan="2"><span data-x="hyperlink annotation">Annotation</span></td>
2500925018
<td class="no"> &middot; </td>
25019+
<td class="no"> &middot; </td>
2501025020
<td>No `<code data-x="http-referer">Referer</code>` (sic) header will be included.
2501125021
Additionally, has the same effect as <code data-x="rel-noopener">noopener</code>.</td>
2501225022
</tr>
@@ -25016,6 +25026,7 @@ document.body.appendChild(wbr);</code></pre>
2501625026
<td><em>not allowed</em></td>
2501725027
<td colspan="2"><span data-x="hyperlink annotation">Annotation</span></td>
2501825028
<td class="no"> &middot; </td>
25029+
<td class="no"> &middot; </td>
2501925030
<td>Creates an <span>auxiliary browsing context</span> if the hyperlink would otherwise create
2502025031
a <span>top-level traversable</span> with a non-<span>auxiliary browsing context</span> (i.e.,
2502125032
has "<code data-x="">_blank</code>" as <code data-x="attr-hyperlink-target">target</code>
@@ -25027,6 +25038,7 @@ document.body.appendChild(wbr);</code></pre>
2502725038
<td><span data-x="external resource link">External Resource</span></td>
2502825039
<td colspan="2"><em>not allowed</em></td>
2502925040
<td class="yes"> Yes </td>
25041+
<td class="no"> &middot; </td>
2503025042
<td>Gives the address of the pingback server that handles pingbacks to the current document.</td>
2503125043
</tr>
2503225044

@@ -25035,6 +25047,7 @@ document.body.appendChild(wbr);</code></pre>
2503525047
<td><span data-x="external resource link">External Resource</span></td>
2503625048
<td colspan="2"><em>not allowed</em></td>
2503725049
<td class="yes"> Yes </td>
25050+
<td class="yes"> Yes </td>
2503825051
<td>Specifies that the user agent should preemptively connect to the target resource's <span>origin</span>.</td>
2503925052
</tr>
2504025053

@@ -25043,6 +25056,7 @@ document.body.appendChild(wbr);</code></pre>
2504325056
<td><span data-x="external resource link">External Resource</span></td>
2504425057
<td colspan="2"><em>not allowed</em></td>
2504525058
<td class="yes"> Yes </td>
25059+
<td class="no"> &middot; </td>
2504625060
<td>Specifies that the user agent should preemptively <span data-x="concept-fetch">fetch</span> and cache the target resource as it is likely to be required for a followup <span data-x="navigate">navigation</span>.</td>
2504725061
</tr>
2504825062

@@ -25051,6 +25065,7 @@ document.body.appendChild(wbr);</code></pre>
2505125065
<td><span data-x="external resource link">External Resource</span></td>
2505225066
<td colspan="2"><em>not allowed</em></td>
2505325067
<td class="yes"> Yes </td>
25068+
<td class="yes"> Yes </td>
2505425069
<td>Specifies that the user agent must preemptively <span data-x="concept-fetch">fetch</span> and cache the target resource for current <span data-x="navigate">navigation</span> according to the <span data-x="concept-potential-destination">potential destination</span> given by the <code data-x="attr-link-as">as</code> attribute (and the <span data-x="concept-request-priority">priority</span> associated with the <span data-x="concept-potential-destination-translate">corresponding</span> <span data-x="concept-request-destination">destination</span>).</td>
2505525070
</tr>
2505625071

@@ -25059,40 +25074,44 @@ document.body.appendChild(wbr);</code></pre>
2505925074
<td><span data-x="external resource link">External Resource</span></td>
2506025075
<td colspan="2"><em>not allowed</em></td>
2506125076
<td class="yes"> Yes </td>
25077+
<td class="no"> &middot; </td>
2506225078
<td>Specifies that the user agent should preemptively <span data-x="concept-fetch">fetch</span> the target resource and process it in a way that helps deliver a faster response in the future.</td>
2506325079
</tr>
2506425080

2506525081
<tr>
25066-
<td><code data-x="rel-prev">prev</code></td> <!-- prev is used more than previous -->
25082+
<td><code data-x="rel-prev">prev</code></td>
2506725083
<td colspan="3"><span>Hyperlink</span></td>
2506825084
<td class="no"> &middot; </td>
25085+
<td class="no"> &middot; </td>
2506925086
<td>Indicates that the current document is a part of a series, and that the previous document in the series is the referenced document.</td>
2507025087
</tr>
2507125088

2507225089
<tr>
25073-
<td><code data-x="rel-search">search</code></td> <!-- used quite a bit -->
25090+
<td><code data-x="rel-search">search</code></td>
2507425091
<td colspan="3"><span>Hyperlink</span></td>
2507525092
<td class="no"> &middot; </td>
25093+
<td class="no"> &middot; </td>
2507625094
<td>Gives a link to a resource that can be used to search through the current document and its related pages.</td>
2507725095
</tr>
2507825096

2507925097
<tr>
25080-
<td><code data-x="rel-stylesheet">stylesheet</code></td> <!-- most commonly used <link rel> value, variants came in 7th, 8th, 12th, 17th... -->
25098+
<td><code data-x="rel-stylesheet">stylesheet</code></td>
2508125099
<td><span data-x="external resource link">External Resource</span></td>
2508225100
<td colspan="2"><em>not allowed</em></td>
2508325101
<td class="yes"> Yes </td>
25102+
<td class="no"> &middot; </td>
2508425103
<td>Imports a style sheet.</td>
2508525104
</tr>
2508625105

2508725106
<tr>
25088-
<td><code data-x="rel-tag">tag</code></td> <!-- second and third most used <a rel> value (third is technically "category tag"). -->
25107+
<td><code data-x="rel-tag">tag</code></td>
2508925108
<td><em>not allowed</em></td>
2509025109
<td><span>Hyperlink</span></td>
2509125110
<td><em>not allowed</em></td>
2509225111
<td class="no"> &middot; </td>
25112+
<td class="no"> &middot; </td>
2509325113
<td>Gives a tag (identified by the given address) that applies to the current document.</td>
2509425114
</tr>
25095-
2509625115
</tbody>
2509725116
</table>
2509825117

0 commit comments

Comments
 (0)