Skip to content

Commit a4ccf54

Browse files
authored
Set requests' render-blocking flag based on blocking="render"
See whatwg/fetch#1433 and whatwg/fetch#1432 for background.
1 parent 0b6a5dd commit a4ccf54

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

source

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,6 +2613,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
26132613
<li><dfn data-x="concept-request-reload-navigation-flag" data-x-href="https://fetch.spec.whatwg.org/#concept-request-reload-navigation-flag">reload-navigation flag</dfn></li>
26142614
<li><dfn data-x="concept-request-history-navigation-flag" data-x-href="https://fetch.spec.whatwg.org/#concept-request-history-navigation-flag">history-navigation flag</dfn></li>
26152615
<li><dfn data-x="concept-request-user-activation" data-x-href="https://fetch.spec.whatwg.org/#request-user-activation">user-activation</dfn></li>
2616+
<li><dfn data-x="concept-request-render-blocking" data-x-href="https://fetch.spec.whatwg.org/#request-render-blocking">render-blocking</dfn></li>
26162617
<li><dfn data-x-href="https://fetch.spec.whatwg.org/#concept-request-add-range-header">add a range header</dfn></li>
26172618
</ul>
26182619
</li>
@@ -16297,6 +16298,13 @@ console.log(style.disabled); // false</code></pre>
1629716298
complete, or, if the style sheet has no <span>critical subresources</span>, once the style sheet
1629816299
has been parsed and processed, the user agent must run these steps:</p>
1629916300

16301+
<p class="XXX">Fetching the <span>critical subresources</span> is not well-defined; probably <a
16302+
href="https://github.com/whatwg/html/issues/968">issue #968</a> is the best resolution for that.
16303+
In the meantime, any <span data-x="critical subresources">critical subresource</span> <span
16304+
data-x="concept-request">request</span> should have its <span
16305+
data-x="concept-request-render-blocking">render-blocking</span> set to whether or not the
16306+
<code>style</code> element is currently <span>render-blocking</span>.</p>
16307+
1630016308
<ol>
1630116309
<li><p>Let <var>element</var> be the <code>style</code> element associated with the style sheet
1630216310
in question.</p></li>
@@ -26742,8 +26750,8 @@ document.body.appendChild(wbr);</code></pre>
2674226750
supported style sheet type, the user agent must instead assume it to be <code>text/css</code>.</p>
2674326751

2674426752
<p>The <span>linked resource fetch setup steps</span> for this type of linked resource, given a
26745-
<code>link</code> element <var>el</var> (ignoring the <span
26746-
data-x="concept-request">request</span>) are:</p>
26753+
<code>link</code> element <var>el</var> and <span data-x="concept-request">request</span>
26754+
<var>request</var>, are:</p>
2674726755

2674826756
<ol>
2674926757
<li><p>If <var>el</var>'s <code data-x="attr-link-disabled">disabled</code> attribute is set,
@@ -26758,13 +26766,19 @@ document.body.appendChild(wbr);</code></pre>
2675826766
<span>potentially render-blocking</span>, then <span>block rendering</span> on
2675926767
<var>el</var>.</p></li>
2676026768

26769+
<li><p>If <var>el</var> is currently <span>render-blocking</span>, then set <var>request</var>'s
26770+
<span data-x="concept-request-render-blocking">render-blocking</span> to true.</p></li>
26771+
2676126772
<li><p>Return true.</p></li>
2676226773
</ol>
2676326774

26764-
<p class="XXX">See <a href="https://github.com/whatwg/html/issues/968">issue #968</a> for plans to
26765-
use the CSSOM <a href="https://drafts.csswg.org/cssom/#fetching-css-style-sheets">fetch a CSS
26775+
<p class="XXX">See <a href="https://github.com/whatwg/html/issues/968">issue #968</a> for plans
26776+
to use the CSSOM <a href="https://drafts.csswg.org/cssom/#fetching-css-style-sheets">fetch a CSS
2676626777
style sheet</a> algorithm instead of the <span>default fetch and process the linked
26767-
resource</span> algorithm.</p>
26778+
resource</span> algorithm. In the meantime, any <span data-x="critical subresources">critical
26779+
subresource</span> <span data-x="concept-request">request</span> should have its <span
26780+
data-x="concept-request-render-blocking">render-blocking</span> set to whether or not the
26781+
<code>link</code> element is currently <span>render-blocking</span>.</p>
2676826782

2676926783
<p>To <span data-x="process the linked resource">process this type of linked resource</span>
2677026784
given a <code>link</code> element <var>el</var>, boolean <var>success</var>, and <span
@@ -60645,6 +60659,10 @@ o............A....e
6064560659
<li><p>Set <var>el</var>'s <span data-x="concept-script-delay-load">delaying the load
6064660660
event</span> to true.</p></li>
6064760661

60662+
<li><p>If <var>el</var> is currently <span>render-blocking</span>, then set
60663+
<var>options</var>'s <span data-x="concept-script-fetch-options-render-blocking">
60664+
render-blocking</span> to true.</p></li>
60665+
6064860666
<li>
6064960667
<p>Switch on <var>el</var>'s <span data-x="concept-script-type">type</span>:</p>
6065060668

@@ -93243,6 +93261,12 @@ document.querySelector("button").addEventListener("click", bound);
9324393261

9324493262
<dd><p>The <span data-x="concept-request-referrer-policy">referrer policy</span> used for the
9324593263
initial fetch and for fetching any imported modules</p></dd>
93264+
93265+
<dt><dfn data-x="concept-script-fetch-options-render-blocking">render-blocking</dfn></dt>
93266+
93267+
<dd><p>The boolean value of <span data-x="concept-request-render-blocking">render-blocking</span>
93268+
used for the initial fetch and for fetching any imported modules. Unless otherwise stated, its
93269+
value is false.</p></dd>
9324693270
</dl>
9324793271

9324893272
<p class="note">Recall that via the <code>import()</code> feature, <span data-x="classic
@@ -93269,9 +93293,11 @@ document.querySelector("button").addEventListener("click", bound);
9326993293
data-x="concept-request-integrity-metadata">integrity metadata</span> to <var>options</var>'s
9327093294
<span data-x="concept-script-fetch-options-integrity">integrity metadata</span>, its <span
9327193295
data-x="concept-request-parser-metadata">parser metadata</span> to <var>options</var>'s <span
93272-
data-x="concept-script-fetch-options-parser">parser metadata</span>, and its <span
93296+
data-x="concept-script-fetch-options-parser">parser metadata</span>, its <span
9327393297
data-x="concept-request-referrer-policy">referrer policy</span> to <var>options</var>'s <span
93274-
data-x="concept-script-fetch-options-referrer-policy">referrer policy</span>.</p></dd>
93298+
data-x="concept-script-fetch-options-referrer-policy">referrer policy</span>, and its
93299+
<span data-x="concept-request-render-blocking">render-blocking</span> to <var>options</var>'s
93300+
<span data-x="concept-script-fetch-options-render-blocking">render-blocking</span>.</p></dd>
9327593301

9327693302
<dt><dfn>set up the module script request</dfn></dt>
9327793303
<dd><p>Set <var>request</var>'s <span data-x="concept-request-nonce-metadata">cryptographic nonce
@@ -93282,9 +93308,11 @@ document.querySelector("button").addEventListener("click", bound);
9328293308
data-x="concept-request-parser-metadata">parser metadata</span> to <var>options</var>'s <span
9328393309
data-x="concept-script-fetch-options-parser">parser metadata</span>, its <span
9328493310
data-x="concept-request-credentials-mode">credentials mode</span> to <var>options</var>'s <span
93285-
data-x="concept-script-fetch-options-credentials">credentials mode</span>, and its <span
93311+
data-x="concept-script-fetch-options-credentials">credentials mode</span>, its <span
9328693312
data-x="concept-request-referrer-policy">referrer policy</span> to <var>options</var>'s <span
93287-
data-x="concept-script-fetch-options-referrer-policy">referrer policy</span>.</p></dd>
93313+
data-x="concept-script-fetch-options-referrer-policy">referrer policy</span>, and its
93314+
<span data-x="concept-request-render-blocking">render-blocking</span> to <var>options</var>'s
93315+
<span data-x="concept-script-fetch-options-render-blocking">render-blocking</span>.</p></dd>
9328893316
</dl>
9328993317

9329093318
<p>For any given <span>script fetch options</span> <var>options</var>, the <dfn>descendant script

0 commit comments

Comments
 (0)