Skip to content

Commit

Permalink
Add the Priority Hints changes to the fetch spec
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeenan committed Nov 2, 2022
1 parent 154061f commit b305dff
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,12 @@ not always relevant and might require different behavior.
<hr>

<p>A <a for=/>request</a> has an associated
<dfn export for=request id=concept-request-priority>priority</dfn> (null or a
<dfn export id=concept-request-priority>priority</dfn>, which is
"<code>high</code>", "<code>low</code>" or "<code>auto</code>". Unless stated otherwise it is
"<code>auto</code>".

<p>A <a for=/>request</a> has an associated
<dfn export for=request id=concept-request-internal-priority>internal priority</dfn> (null or a
user-agent-defined object). Unless otherwise stated it is null.

<p>A <a for=/>request</a> has an associated
Expand Down Expand Up @@ -4133,10 +4138,10 @@ the request.
<a for=/>header value</a>) to <var>request</var>'s <a for=request>header list</a>.

<li>
<p>If <var>request</var>'s <a for=request>priority</a> is null, then use <var>request</var>'s
<a for=request>initiator</a>, <a for=request>destination</a>, and
<a for=request>render-blocking</a> appropriately in setting <var>request</var>'s
<a for=request>priority</a> to a user-agent-defined object.
<p>If <var>request</var>'s <a for=request>internal priority</a> is null, then use
<var>request</var>'s <a for=request>priority</a>, <a for=request>initiator</a>,
<a for=request>destination</a>, and <a for=request>render-blocking</a> appropriately in setting
<var>request</var>'s <a for=request>internal priority</a> to a user-agent-defined object.

<p class=note>The user-agent-defined object could encompass stream weight and dependency for
HTTP/2, and equivalent information used to prioritize dispatch and processing of HTTP/1 fetches.
Expand Down Expand Up @@ -6872,6 +6877,7 @@ interface Request {
readonly attribute boolean isHistoryNavigation;
readonly attribute AbortSignal signal;
readonly attribute RequestDuplex duplex;
readonly attribute FetchPriority priority;

[NewObject] Request clone();
};
Expand All @@ -6891,6 +6897,7 @@ dictionary RequestInit {
boolean keepalive;
AbortSignal? signal;
RequestDuplex duplex;
FetchPriority priority;
any window; // can only be set to null
};

Expand All @@ -6900,6 +6907,7 @@ enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
enum RequestRedirect { "follow", "error", "manual" };
enum RequestDuplex { "half" };
enum FetchPriority { "high", "low", "auto" };
</pre>

<p class="note no-backref">"<code>serviceworker</code>" is omitted from
Expand Down Expand Up @@ -6997,6 +7005,9 @@ object), initially null.
set when {{RequestInit/body}} is a {{ReadableStream}} object. <span class=note>See
<a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a> for defining
"<code>full</code>".</span>

<dt>{{RequestInit/priority}}
<dd>A string to set <var>request</var>'s {{Request/priority}}.
</dl>

<dt><code><var>request</var> . <a attribute for=Request>method</a></code>
Expand Down Expand Up @@ -7070,6 +7081,10 @@ object), initially null.
<span class=note>See <a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a> for
defining "<code>full</code>".</span>

<dt><code><var>request</var> . <a attribute for=Request>priority</a></code>
<dd>Returns the <a>priority</a> of the <var>request</var>, e.g., "<code>high</code>",
"<code>low</code>" or "<code>auto</code>".

<dt><code><var>request</var> . <a method for=Request>clone</a>()</code>
<dd><p>Returns a clone of <var>request</var>.
</dl>
Expand Down Expand Up @@ -7184,6 +7199,9 @@ constructor steps are:
<dt><a for=request>priority</a>
<dd><var>request</var>'s <a for=request>priority</a>.

<dt><a for=request>internal priority</a>
<dd><var>request</var>'s <a for=request>internal priority</a>.

<dt><a for=request>origin</a>
<dd><var>request</var>'s <a for=request>origin</a>. <span class=note>The propagation of the
<a for=/>origin</a> is only significant for navigation requests being handled by a service
Expand Down Expand Up @@ -8431,6 +8449,7 @@ Odin Hørthe Omdal,
Olli Pettay,
Ondřej Žára,
O. Opsec,
Patrick Meenan,
Perry Jiang<!-- perryjiang; Github -->,
Philip Jägenstedt,
R. Auburn,
Expand Down

0 comments on commit b305dff

Please sign in to comment.