@@ -14239,20 +14239,72 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
14239
14239
14240
14240
<h5>Processing `<code data-x="http-link">Link</code>` headers</h5>
14241
14241
14242
- <p>HTTP `<code data-x="http-link">Link</code>` headers, if supported, must be assumed to come
14243
- before any links in the document, in the order that they were given in the HTTP message. These
14244
- headers are to be processed according to the rules given in the relevant specifications. <ref
14245
- spec=HTTP> <ref spec=WEBLINK></p> <!-- WEBLINK is ref for Link: header -->
14246
-
14247
- <p class="note">Registration of relation types in HTTP `<code data-x="http-link">Link</code>`
14248
- headers is distinct from <a href="#linkTypes">HTML link types</a>, and thus their semantics can be
14249
- different from same-named HTML types.</p>
14250
-
14251
- <p class="XXX">The processing of `<code data-x="http-link">Link</code>` headers, in particular
14252
- their influence on a <code>Document</code>'s <span>script-blocking style sheet counter</span>, is
14253
- not defined. See <a href="https://github.com/whatwg/html/issues/4224">issue #4224</a> for
14254
- discussion on integrating this into the spec.</p>
14242
+ <p>To <dfn>process link headers</dfn> given <code>Document</code> <var>doc</var>,
14243
+ <span data-x="concept-response">response</span>, and a "<code data-x="">pre-media</code>" or
14244
+ "<code data-x="">media</code>" <var>phase</var>:</p>
14245
+
14246
+ <ol>
14247
+ <li><p>Let <var>linkHeaders</var> be the result of <span>getting a structured field value</span>
14248
+ given `<code>Link</code>` and "<code data-x="">list</code>" from
14249
+ <var>response</var>'s <span data-x="concept-response-header-list">header list</span>.</p></li>
14250
+
14251
+ <li><p>If <var>linkHeaders</var> is null, then return.</p></li>
14252
+
14253
+ <li>
14254
+ <p><span data-x="list iterate">For each</span> <var>rawLink</var> of
14255
+ <var>linkHeaders</var>, run these steps:</p>
14255
14256
14257
+ <ol>
14258
+ <li><p>Let (<var>href</var>, <var>params</var>) be the result of parsing
14259
+ <var>linkHeader</var> according to the `<code data-x="http-link">Link</code>` header
14260
+ Serialization rules. <ref spec=HTTP> <ref spec=WEBLINK></p></li>
14261
+ <!-- WEBLINK is ref for Link: header -->
14262
+
14263
+ <li>
14264
+ <p>If <var>params</var>["<code data-x="attr-link-rel">rel</code>"] is
14265
+ "<code data-x="rel-preload">preload</code>", then abort these steps.</p>
14266
+
14267
+ <p class=note>Additional support for link types can be added here in the future.</p>
14268
+ </li>
14269
+
14270
+ <li><p>Let <var>expectedPhase</var> be "<code data-x="">media</code>" if either
14271
+ "<code data-x="attr-img-srcset">srcset</code>",
14272
+ "<code data-x="attr-link-imagesrcset">imagesrcset</code>", or <code
14273
+ data-x="attr-link-media">media</code>" <span data-x="map exists">exist</span> in
14274
+ <var>params</var>; Otherwise false.</p></li>
14275
+
14276
+ <li><p>If <var>expectedPhase</var> is not <var>phase</var>, then abort these
14277
+ steps.</p></li>
14278
+
14279
+ <li><p>If <var>params</var> includes "<code data-x="attr-link-media">media</code>" and
14280
+ <var>params</var>["<code data-x="attr-link-media">media</code>"] does not
14281
+ <span data-x="matches the environment">match the environment</span>, then abort these
14282
+ steps.</p></li>
14283
+
14284
+ <li><p>Let <var>element</var> be the result of
14285
+ <span data-x="create an element">creating an element</span> given <var>document</var>,
14286
+ <code>link</code>, and the <span>HTML namespace</span>.</p></li>
14287
+
14288
+ <li><p><span data-x="map iterate">For each</span> <var>entry</var> in <var>params</var>: If
14289
+ <var>entry</var>[0] is "<code data-x="attr-link-as">as</code>",
14290
+ "<code data-x="attr-img-srcset">rel</code>", "<code data-x="attr-link-type">type</code>",
14291
+ "<code data-x="attr-link-crossorigin">crossorigin</code>",
14292
+ "<code data-x="attr-link-imagesizes">imagesizes</code>",
14293
+ "<code data-x="attr-link-imagesrcset">imagesrcset</code>", or
14294
+ "<code data-x="attr-link-media">media</code>", then <span data-x="list append">append</span>
14295
+ <var>entry</var> to <var>element</var>'s <span>attribute list</span>.</p></li>
14296
+
14297
+ <li><p><span data-x="fetch and process the linked resource">Fetch and process</span>
14298
+ <var>el</var>.</p></li>
14299
+ </ol>
14300
+ </li>
14301
+ </ol>
14302
+
14303
+ <p class="XXX">The processing of additional `<code data-x="http-link">Link</code>` headers, in
14304
+ particular their influence on a <code>Document</code>'s
14305
+ <span>script-blocking style sheet counter</span>, is not defined. See
14306
+ <a href="https://github.com/whatwg/html/issues/4224">issue #4224</a> for
14307
+ discussion on integrating this into the spec.</p>
14256
14308
14257
14309
</div>
14258
14310
@@ -88778,7 +88830,7 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
88778
88830
data-x="navigation-params-response">response</span>'s <span
88779
88831
data-x="concept-response-service-worker-timing-info">service worker timing info</span>.</p></li>
88780
88832
88781
- <li>
88833
+ <li>
88782
88834
<p>If <var>navigationParams</var>'s <span data-x="navigation-params-response">response</span>
88783
88835
has a `<code>Refresh</code>` header, then:</p>
88784
88836
@@ -88795,6 +88847,10 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
88795
88847
href="https://github.com/whatwg/html/issues/2900">issue #2900</a>.</p>
88796
88848
</li>
88797
88849
88850
+ <li><p><span>Process link headers</span> given <var>document</var>, <var>navigationParams</var>'s
88851
+ <span data-x="navigation-params-response">response</span>, and
88852
+ "<code data-x="">pre-media</code>".</p></li>
88853
+
88798
88854
<li><p>Return <var>document</var>.</p></li>
88799
88855
</ol>
88800
88856
@@ -89008,12 +89064,18 @@ new PaymentRequest(…); // Allowed to use
89008
89064
<var>navigationParams</var>.</p></li>
89009
89065
89010
89066
<li>
89011
- <p>Create an <span>HTML parser</span> and associate it with the <var>document</var>. Each
89067
+ <p>Create an <span>HTML parser</span> and associate it with the <var>document</var>. Each
89012
89068
<span data-x="concept-task">task</span> that the <span>networking task source</span> places on
89013
89069
the <span>task queue</span> while fetching runs must then fill the parser's <span>input byte
89014
89070
stream</span> with the fetched bytes and cause the <span>HTML parser</span> to perform the
89015
89071
appropriate processing of the input stream.</p>
89016
89072
89073
+ <p>The first <span data-x="concept-task">task</span> that the
89074
+ <span>networking task source</span> places on the <span>task queue</span> while fetching runs
89075
+ must <li><p><span>process link headers</span> given <var>document</var>,
89076
+ <var>navigationParams</var>'s <span data-x="navigation-params-response">response</span>, and
89077
+ "<code data-x="">media</code>".</p>
89078
+
89017
89079
<p class="note">The <span>input byte stream</span> converts bytes into characters for use in the
89018
89080
<span data-x="tokenization">tokenizer</span>. This process relies, in part, on character encoding
89019
89081
information found in the real <span data-x="Content-Type">Content-Type metadata</span> of the
0 commit comments