Skip to content

Commit 3179129

Browse files
committed
WIP
1 parent d181ee3 commit 3179129

File tree

1 file changed

+108
-22
lines changed

1 file changed

+108
-22
lines changed

source

Lines changed: 108 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14246,9 +14246,10 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
1424614246
"<code data-x="">media</code>" <var>phase</var>:</p>
1424714247

1424814248
<ol>
14249-
<li><p>Let <var>linkHeaders</var> be the result of <span>getting a structured field value</span>
14250-
given `<code>Link</code>` and "<code data-x="">list</code>" from
14251-
<var>response</var>'s <span data-x="concept-response-header-list">header list</span>.</p></li>
14249+
<li><p>Let <var>linkHeaders</var> be the result of <span
14250+
data-x="concept-header-list-get-decode-split">getting, decoding, and splitting</span>
14251+
`<code>Link</code>` from <var>response</var>'s
14252+
<span data-x="concept-response-header-list">header list</span>.</p></li>
1425214253

1425314254
<li><p>If <var>linkHeaders</var> is null, then return.</p></li>
1425414255

@@ -14257,14 +14258,13 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
1425714258
<var>linkHeaders</var>, run these steps:</p>
1425814259

1425914260
<ol>
14260-
<li><p>Let (<var>href</var>, <var>params</var>) be the result of parsing
14261-
<var>linkHeader</var> according to the `<code data-x="http-link">Link</code>` header
14262-
Serialization rules. <ref spec=HTTP> <ref spec=WEBLINK></p></li>
14263-
<!-- WEBLINK is ref for Link: header -->
14261+
<li><p>Let (<var>href</var>, <var>params</var>) be the result of
14262+
<span data-x="parse a link header"> parsing</span> <var>linkHeader</var>.
14263+
according to the `<code data-x="http-link">Link</code>` header
1426414264

1426514265
<li>
14266-
<p>If <var>params</var>["<code data-x="attr-link-rel">rel</code>"] is
14267-
"<code data-x="rel-preload">preload</code>", then abort these steps.</p>
14266+
<p>If <var>params</var>["<code data-x="attr-link-rel">rel</code>"] is not
14267+
"<code data-x="rel-preload">preload</code>", then <span>continue</span>.</p>
1426814268

1426914269
<p class=note>Additional support for link types can be added here in the future.</p>
1427014270
</li>
@@ -14273,15 +14273,15 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
1427314273
"<code data-x="attr-img-srcset">srcset</code>",
1427414274
"<code data-x="attr-link-imagesrcset">imagesrcset</code>", or <code
1427514275
data-x="attr-link-media">media</code>" <span data-x="map exists">exist</span> in
14276-
<var>params</var>; Otherwise false.</p></li>
14276+
<var>params</var>; otherwise false.</p></li>
1427714277

14278-
<li><p>If <var>expectedPhase</var> is not <var>phase</var>, then abort these
14279-
steps.</p></li>
14278+
<li><p>If <var>expectedPhase</var> is not <var>phase</var>, then
14279+
<span>continue</span>.</p></li>
1428014280

1428114281
<li><p>If <var>params</var> includes "<code data-x="attr-link-media">media</code>" and
1428214282
<var>params</var>["<code data-x="attr-link-media">media</code>"] does not
14283-
<span data-x="matches the environment">match the environment</span>, then abort these
14284-
steps.</p></li>
14283+
<span data-x="matches the environment">match the environment</span>, then
14284+
<span>continue</span>.</p></li>
1428514285

1428614286
<li><p>Let <var>element</var> be the result of
1428714287
<span data-x="create an element">creating an element</span> given <var>document</var>,
@@ -14292,23 +14292,103 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
1429214292
"<code data-x="attr-img-srcset">rel</code>", "<code data-x="attr-link-type">type</code>",
1429314293
"<code data-x="attr-link-crossorigin">crossorigin</code>",
1429414294
"<code data-x="attr-link-imagesizes">imagesizes</code>",
14295+
"<code data-x="attr-link-blocking">blocking</code>",
14296+
"<code data-x="attr-link-rev">rev</code>",
14297+
"<code data-x="attr-link-integrity">integrity</code>",
1429514298
"<code data-x="attr-link-imagesrcset">imagesrcset</code>", or
14296-
"<code data-x="attr-link-media">media</code>", then <span data-x="list append">append</span>
14297-
<var>entry</var> to <var>element</var>'s <span>attribute list</span>.</p></li>
14299+
"<code data-x="attr-link-media">media</code>", then
14300+
<span data-x="concept-element-attributes-set-value">set an attribute value</span> for
14301+
<var>element</var> using <var>entry</var>[0] and <var>entry</var>[1].</p></li>
14302+
14303+
<li><p><span data-x="concept-element-attributes-set-value">Set an attribute value</span> for
14304+
<var>element</var> using "<code data-x="attr-link-href">href</code>" and
14305+
<var>href</var>.</p></li>
1429814306

1429914307
<li><p><span data-x="fetch and process the linked resource">Fetch and process</span>
1430014308
<var>el</var>.</p></li>
1430114309
</ol>
1430214310
</li>
1430314311
</ol>
1430414312

14305-
<p class="XXX">The processing of additional `<code data-x="http-link">Link</code>` headers, in
14306-
particular their influence on a <code>Document</code>'s
14307-
<span>script-blocking style sheet counter</span>, is not defined. See
14313+
<p class="XXX">The processing of `<code data-x="http-link">Link</code>` headers apart from
14314+
<code data-x="rel-preload">preload</code>, in particular their influence on a
14315+
<code>Document</code>'s <span>script-blocking style sheet counter</span>, is not defined. See
1430814316
<a href="https://github.com/whatwg/html/issues/4224">issue #4224</a> for
1430914317
discussion on integrating this into the spec.</p>
1431014318

14311-
</div>
14319+
<p>To <dfn>parse a link header</dfn> given a <span>string</span> <var>input<var>, do the
14320+
following, as specified in Web Linking: <ref spec=WEBLINK></p>
14321+
14322+
<ol>
14323+
<li><p>Let <var>position</var> point at the first code point of <var>input</var>.</p></li>
14324+
14325+
<li><p><span>Skip ASCII whitespace</span> within <var>input</var> given
14326+
<var>position</var>.</p></li>
14327+
14328+
<li><p>If <var>input</var>[<var>position</var>] is an U+003C LESS-THAN SIGN (&lt;),
14329+
then advance <var>position</var> by 1; otherwise return null.</p></li>
14330+
14331+
<li><p><span>Skip ASCII whitespace</span> within <var>input</var> given
14332+
<var>position</var>.</p></li>
14333+
14334+
<li><p><span>Collect a sequence of code points</span> that are not an U+003E GREATER-THAN SIGN
14335+
(>) from <var>input</var> given <var>position</var>, and let <var>href</var> be the
14336+
result.</p></li>
14337+
14338+
<li><p>If <var>position</var> is at the end of <var>input, return null; otherwise advance
14339+
<var>position</var> by 1.</p></li>
14340+
14341+
<li><p>Let <var>href</var> be the result of <span data-x="strip leading and trailing ASCII
14342+
whitespace">stripping leading and trailing ASCII whitespace</span> <var>href</var>.</p></li>
14343+
14344+
<li><p>If <var>href</var> is an empty string, return null.</p></li>
14345+
14346+
<li><p>Advance <var>position</var> to <var>gtSigns</var>[0] + 1.</p></li>
14347+
14348+
<li><p>Let <var>params</var> be a new <span data-x="ordered map">map</span>.</p></li>
14349+
14350+
<li>
14351+
<p>While <var>position</var> is not past the end of <var>input</var>:<p>
14352+
14353+
<ol>
14354+
<li><p><span>Skip ASCII whitespace</span> within <var>input</var> given
14355+
<var>position</var>.</p></li>
14356+
14357+
<li><p>If <var>input</var>[<var>position</var>] is an U+003B SEMICOLON (;), then advance
14358+
<var>position</var> by 1; otherwise return null.</p></li>
14359+
14360+
<li><p><span>Skip ASCII whitespace</span> within <var>input</var> given
14361+
<var>position</var>.</p></li>
14362+
14363+
<li><p>If <var>position</var> is past the end of <var>input</var>, then return null.</p></li>
14364+
14365+
14366+
</ol>
14367+
</li>
14368+
14369+
<li><p><span data-x="list iterate">For each</span> token returned by
14370+
<span data-x="strictly split">strictly splitting</span> <var> on the U+003B SEMICOLON character (;)
14371+
14372+
<li><p>Let <var>paramsString</var> be the result of
14373+
<span data-x="strip leading and trailing ASCII
14374+
whitespace">stripping leading and trailing ASCII whitespace</span> from
14375+
the substring of <var>trimmedHeader</var> between <var>gtSigns</var>[0] and
14376+
<var>trimmedHeader</var>'s length.</p></li>
14377+
14378+
<li><p>If <var>paramsString</var>[0] is not U+003B SEMICOLON (;), return null.
14379+
14380+
14381+
14382+
14383+
<li><p>Return (<var>href</var>, <var>params</var>).</p></li>
14384+
14385+
</ol>
14386+
14387+
<code>Document</code> <var>doc</var>,
14388+
<span data-x="concept-response">response</span>, and a "<code data-x="">pre-media</code>" or
14389+
"<code data-x="">media</code>" <var>phase</var>:</p>
14390+
14391+
</div>
1431214392

1431314393
<h5>Providing users with a means to follow hyperlinks created using the <code>link</code>
1431414394
element</h5>
@@ -88832,7 +88912,7 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
8883288912
data-x="navigation-params-response">response</span>'s <span
8883388913
data-x="concept-response-service-worker-timing-info">service worker timing info</span>.</p></li>
8883488914

88835-
<li>
88915+
<li>
8883688916
<p>If <var>navigationParams</var>'s <span data-x="navigation-params-response">response</span>
8883788917
has a `<code>Refresh</code>` header, then:</p>
8883888918

@@ -89076,7 +89156,7 @@ new PaymentRequest(&hellip;); // Allowed to use
8907689156
<span>networking task source</span> places on the <span>task queue</span> while fetching runs
8907789157
must <li><p><span>process link headers</span> given <var>document</var>,
8907889158
<var>navigationParams</var>'s <span data-x="navigation-params-response">response</span>, and
89079-
"<code data-x="">media</code>".</p>
89159+
"<code data-x="">media</code>", after it has been procesed by the <span>HTML parser</span>.</p>
8908089160

8908189161
<p class="note">The <span>input byte stream</span> converts bytes into characters for use in the
8908289162
<span data-x="tokenization">tokenizer</span>. This process relies, in part, on character encoding
@@ -89110,6 +89190,12 @@ new PaymentRequest(&hellip;); // Allowed to use
8911089190
<var>navigationParams</var>. They must also create a corresponding <span>XML parser</span>.
8911189191
<ref spec=XML> <ref spec=XMLNS> <ref spec=RFC7303> <ref spec=DOM></p>
8911289192

89193+
<p>The first <span data-x="concept-task">task</span> that the
89194+
<span>networking task source</span> places on the <span>task queue</span> while fetching runs
89195+
must <li><p><span>process link headers</span> given <var>document</var>,
89196+
<var>navigationParams</var>'s <span data-x="navigation-params-response">response</span>, and
89197+
"<code data-x="">media</code>", after it has been procesed by the <span>XML parser</span>.</p>
89198+
8911389199
<p class="note">At the time of writing, the XML specification community had not actually yet
8911489200
specified how XML and the DOM interact.</p> <!--XMLPARSE-->
8911589201

0 commit comments

Comments
 (0)