Skip to content

Commit 06a38bc

Browse files
pmeenanannevk
andauthored
Integrate Priority Hints
- Renames the request priority concept to internal priority and "adds" priority for usage by APIs. - Adds a new priority member to RequestInit for specifying a priority hint. These changes combined with whatwg/html#8470 obsolete the Priority Hints specification: https://wicg.github.io/priority-hints/. Tests: https://chromium-review.googlesource.com/c/chromium/src/+/4097472. Fixes #1319. Co-authored-by: Anne van Kesteren <[email protected]>
1 parent 897c560 commit 06a38bc

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

fetch.bs

+35-10
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,12 @@ not always relevant and might require different behavior.
18481848
<hr>
18491849

18501850
<p>A <a for=/>request</a> has an associated
1851-
<dfn export for=request id=concept-request-priority>priority</dfn> (null or a
1852-
user-agent-defined object). Unless otherwise stated it is null.
1851+
<dfn export for=request>priority</dfn>, which is "<code>high</code>", "<code>low</code>", or
1852+
"<code>auto</code>". Unless stated otherwise it is "<code>auto</code>".
1853+
1854+
<p>A <a for=/>request</a> has an associated
1855+
<dfn export for=request oldids=concept-request-priority>internal priority</dfn> (null or an
1856+
<a>implementation-defined</a> object). Unless otherwise stated it is null.
18531857

18541858
<p>A <a for=/>request</a> has an associated
18551859
<dfn export for=request id=concept-request-origin>origin</dfn>, which is
@@ -4281,13 +4285,16 @@ the request.
42814285
<a for=/>header value</a>) to <var>request</var>'s <a for=request>header list</a>.
42824286

42834287
<li>
4284-
<p>If <var>request</var>'s <a for=request>priority</a> is null, then use <var>request</var>'s
4285-
<a for=request>initiator</a>, <a for=request>destination</a>, and
4286-
<a for=request>render-blocking</a> appropriately in setting <var>request</var>'s
4287-
<a for=request>priority</a> to a user-agent-defined object.
4288+
<p>If <var>request</var>'s <a for=request>internal priority</a> is null, then use
4289+
<var>request</var>'s <a for=request>priority</a>, <a for=request>initiator</a>,
4290+
<a for=request>destination</a>, and <a for=request>render-blocking</a> in an
4291+
<a>implementation-defined</a> manner to set <var>request</var>'s
4292+
<a for=request>internal priority</a> to an <a>implementation-defined</a> object.
42884293

4289-
<p class=note>The user-agent-defined object could encompass stream weight and dependency for
4290-
HTTP/2, and equivalent information used to prioritize dispatch and processing of HTTP/1 fetches.
4294+
<p class=note>The <a>implementation-defined</a> object could encompass stream weight and
4295+
dependency for HTTP/2, priorities used in <cite>Extensible Prioritization Scheme for HTTP</cite>
4296+
for transports where it applies (including HTTP/3), and equivalent information used to prioritize
4297+
dispatch and processing of HTTP/1 fetches. [[!RFC9218]]
42914298

42924299
<li>
42934300
<p>If <var>request</var> is a <a>subresource request</a>, then:
@@ -7043,6 +7050,7 @@ dictionary RequestInit {
70437050
boolean keepalive;
70447051
AbortSignal? signal;
70457052
RequestDuplex duplex;
7053+
RequestPriority priority;
70467054
any window; // can only be set to null
70477055
};
70487056

@@ -7052,6 +7060,7 @@ enum RequestCredentials { "omit", "same-origin", "include" };
70527060
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
70537061
enum RequestRedirect { "follow", "error", "manual" };
70547062
enum RequestDuplex { "half" };
7063+
enum RequestPriority { "high", "low", "auto" };
70557064
</pre>
70567065

70577066
<p class="note no-backref">"<code>serviceworker</code>" is omitted from
@@ -7149,6 +7158,9 @@ object), initially null.
71497158
set when {{RequestInit/body}} is a {{ReadableStream}} object. <span class=note>See
71507159
<a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a> for defining
71517160
"<code>full</code>".</span>
7161+
7162+
<dt>{{RequestInit/priority}}
7163+
<dd>A string to set <var>request</var>'s <a for=request>priority</a>.
71527164
</dl>
71537165

71547166
<dt><code><var>request</var> . <a attribute for=Request>method</a></code>
@@ -7333,8 +7345,8 @@ constructor steps are:
73337345
<dt><a for=request>window</a>
73347346
<dd><var>window</var>.
73357347

7336-
<dt><a for=request>priority</a>
7337-
<dd><var>request</var>'s <a for=request>priority</a>.
7348+
<dt><a for=request>internal priority</a>
7349+
<dd><var>request</var>'s <a for=request>internal priority</a>.
73387350

73397351
<dt><a for=request>origin</a>
73407352
<dd><var>request</var>'s <a for=request>origin</a>. <span class=note>The propagation of the
@@ -7497,6 +7509,18 @@ constructor steps are:
74977509
<li><p>If <var>init</var>["{{RequestInit/signal}}"] <a for=map>exists</a>, then set
74987510
<var>signal</var> to it.
74997511

7512+
<li>
7513+
<p>If <var>init</var>["{{RequestInit/priority}}"] <a for=map>exists</a>, then:
7514+
7515+
<ol>
7516+
<li><p>If <var>request</var>'s <a for=request>internal priority</a> is not null, then update
7517+
<var>request</var>'s <a for=request>internal priority</a> in an <a>implementation-defined</a>
7518+
manner.
7519+
7520+
<li><p>Otherwise, set <var>request</var>'s <a for=request>priority</a> to
7521+
<var>init</var>["{{RequestInit/priority}}"].
7522+
</ol>
7523+
75007524
<li><p>Set <a>this</a>'s <a for=Request>request</a> to <var>request</var>.
75017525

75027526
<li><p>Set <a>this</a>'s <a for=Request>signal</a> to a <a for=/>new</a> {{AbortSignal}} object
@@ -8579,6 +8603,7 @@ Odin Hørthe Omdal,
85798603
Olli Pettay,
85808604
Ondřej Žára,
85818605
O. Opsec,
8606+
Patrick Meenan,
85828607
Perry Jiang<!-- perryjiang; Github -->,
85838608
Philip Jägenstedt,
85848609
R. Auburn,

0 commit comments

Comments
 (0)