Skip to content

Commit 9b565fc

Browse files
pmeenanannevk
andcommitted
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: TODO. Fixes whatwg#1319. Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
1 parent 7d951ac commit 9b565fc

1 file changed

Lines changed: 33 additions & 10 deletions

File tree

fetch.bs

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,8 +1829,11 @@ not always relevant and might require different behavior.
18291829
<hr>
18301830

18311831
<p>A <a for=/>request</a> has an associated
1832-
<dfn export for=request id=concept-request-priority>priority</dfn> (null or a
1833-
user-agent-defined object). Unless otherwise stated it is null.
1832+
<dfn export for=request>priority</dfn>, which is "<code>high</code>", "<code>low</code>", or
1833+
"<code>auto</code>". Unless stated otherwise it is "<code>auto</code>".
1834+
1835+
<p>A <a for=/>request</a> has an associated <dfn export for=request>internal priority</dfn> (null
1836+
or an <a>implementation-defined</a> object). Unless otherwise stated it is null.
18341837

18351838
<p>A <a for=/>request</a> has an associated
18361839
<dfn export for=request id=concept-request-origin>origin</dfn>, which is
@@ -4243,13 +4246,16 @@ the request.
42434246
<a for=/>header value</a>) to <var>request</var>'s <a for=request>header list</a>.
42444247

42454248
<li>
4246-
<p>If <var>request</var>'s <a for=request>priority</a> is null, then use <var>request</var>'s
4247-
<a for=request>initiator</a>, <a for=request>destination</a>, and
4248-
<a for=request>render-blocking</a> appropriately in setting <var>request</var>'s
4249-
<a for=request>priority</a> to a user-agent-defined object.
4249+
<p>If <var>request</var>'s <a for=request>internal priority</a> is null, then use
4250+
<var>request</var>'s <a for=request>priority</a>, <a for=request>initiator</a>,
4251+
<a for=request>destination</a>, and <a for=request>render-blocking</a> appropriately in setting
4252+
<var>request</var>'s <a for=request>internal priority</a> to an <a>implementation-defined</a>
4253+
object.
42504254

4251-
<p class=note>The user-agent-defined object could encompass stream weight and dependency for
4252-
HTTP/2, and equivalent information used to prioritize dispatch and processing of HTTP/1 fetches.
4255+
<p class=note>The <a>implementation-defined</a> object could encompass stream weight and
4256+
dependency for HTTP/2, priorities used in <cite>Extensible Prioritization Scheme for HTTP</cite>
4257+
for transports where it applies (including HTTP/3), and equivalent information used to prioritize
4258+
dispatch and processing of HTTP/1 fetches. [[!RFC9218]]
42534259

42544260
<li>
42554261
<p>If <var>request</var> is a <a>subresource request</a>, then:
@@ -7009,6 +7015,7 @@ dictionary RequestInit {
70097015
boolean keepalive;
70107016
AbortSignal? signal;
70117017
RequestDuplex duplex;
7018+
RequestPriority priority;
70127019
any window; // can only be set to null
70137020
};
70147021

@@ -7018,6 +7025,7 @@ enum RequestCredentials { "omit", "same-origin", "include" };
70187025
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
70197026
enum RequestRedirect { "follow", "error", "manual" };
70207027
enum RequestDuplex { "half" };
7028+
enum RequestPriority { "high", "low", "auto" };
70217029
</pre>
70227030

70237031
<p class="note no-backref">"<code>serviceworker</code>" is omitted from
@@ -7115,6 +7123,9 @@ object), initially null.
71157123
set when {{RequestInit/body}} is a {{ReadableStream}} object. <span class=note>See
71167124
<a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a> for defining
71177125
"<code>full</code>".</span>
7126+
7127+
<dt>{{RequestInit/priority}}
7128+
<dd>A string to set <var>request</var>'s <a for=request>priority</a>.
71187129
</dl>
71197130

71207131
<dt><code><var>request</var> . <a attribute for=Request>method</a></code>
@@ -7299,8 +7310,8 @@ constructor steps are:
72997310
<dt><a for=request>window</a>
73007311
<dd><var>window</var>.
73017312

7302-
<dt><a for=request>priority</a>
7303-
<dd><var>request</var>'s <a for=request>priority</a>.
7313+
<dt><a for=request>internal priority</a>
7314+
<dd><var>request</var>'s <a for=request>internal priority</a>.
73047315

73057316
<dt><a for=request>origin</a>
73067317
<dd><var>request</var>'s <a for=request>origin</a>. <span class=note>The propagation of the
@@ -7463,6 +7474,17 @@ constructor steps are:
74637474
<li><p>If <var>init</var>["{{RequestInit/signal}}"] <a for=map>exists</a>, then set
74647475
<var>signal</var> to it.
74657476

7477+
<li>
7478+
<p>If <var>init</var>["{{RequestInit/priority}}"] <a for=map>exists</a>, then:
7479+
7480+
<ol>
7481+
<li><p>If <var>request</var>'s <a for=request>internal priority</a> is not null, then update
7482+
<var>request</var>'s <a for=request>internal priority</a> appropriately.
7483+
7484+
<li><p>Otherwise, set <var>request</var>'s <a for=request>priority</a> to
7485+
<var>init</var>["{{RequestInit/priority}}"].
7486+
</ol>
7487+
74667488
<li><p>Set <a>this</a>'s <a for=Request>request</a> to <var>request</var>.
74677489

74687490
<li><p>Set <a>this</a>'s <a for=Request>signal</a> to a <a for=/>new</a> {{AbortSignal}} object
@@ -8545,6 +8567,7 @@ Odin Hørthe Omdal,
85458567
Olli Pettay,
85468568
Ondřej Žára,
85478569
O. Opsec,
8570+
Patrick Meenan,
85488571
Perry Jiang<!-- perryjiang; Github -->,
85498572
Philip Jägenstedt,
85508573
R. Auburn,

0 commit comments

Comments
 (0)