@@ -199,6 +199,7 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
199
199
<dt> <dfn for="fetch params" id=fetch-params-process-request-body>process request body chunk length</dfn>
200
200
(default null)
201
201
<dt> <dfn for="fetch params">process request end-of-body</dfn> (default null)
202
+ <dt> <dfn for="fetch params">process early hints response</dfn> (default null)
202
203
<dt> <dfn for="fetch params">process response</dfn> (default null)
203
204
<dt> <dfn for="fetch params">process response end-of-body</dfn> (default null)
204
205
<dt> <dfn for="fetch params">process response consume body</dfn> (default null)
@@ -1130,7 +1131,7 @@ format of range header value can be set using <a>add a range header</a>.
1130
1131
<p class=XXX> Various edge cases in mapping HTTP/1's <code> status-code</code> to this concept are
1131
1132
worked on in <a href=https://github.com/whatwg/fetch/issues/1156>issue #1156</a> .
1132
1133
1133
- <p> A <dfn export>null body status</dfn> is a <a for=/>status</a> that is 101, 204, 205, or 304.
1134
+ <p> A <dfn export>null body status</dfn> is a <a for=/>status</a> that is 101, 103, 204, 205, or 304.
1134
1135
1135
1136
<p> An <dfn export>ok status</dfn> is a <a for=/>status</a> in the range 200 to 299, inclusive.
1136
1137
@@ -3787,15 +3788,16 @@ optional algorithm
3787
3788
<dfn export for=fetch id=process-request-body><var>processRequestBodyChunkLength</var></dfn> , an
3788
3789
optional algorithm
3789
3790
<dfn export for=fetch id=process-request-end-of-body oldids=process-request-end-of-file><var>processRequestEndOfBody</var></dfn> ,
3790
- an optional algorithm <dfn export for=fetch id=process-response ><var>processResponse </var></dfn> , an
3791
- optional algorithm <dfn export for=fetch><var>processResponseEndOfBody </var></dfn> , an optional
3792
- algorithm
3791
+ an optional algorithm <dfn export for=fetch><var>processEarlyHintsResponse </var></dfn> , an optional
3792
+ algorithm <dfn export for=fetch id=process-response ><var>processResponse </var></dfn> , an optional
3793
+ algorithm <dfn export for=fetch><var>processResponseEndOfBody</var></dfn> , an optional algorithm
3793
3794
<dfn export for=fetch id=process-response-end-of-body oldids=process-response-end-of-file><var>processResponseConsumeBody</var></dfn> ,
3794
3795
and an optional boolean <dfn export for=fetch><var>useParallelQueue</var></dfn> (default false), run
3795
3796
the steps below. If given, <var> processRequestBodyChunkLength</var> must be an algorithm accepting
3796
3797
an integer representing the number of bytes transmitted. If given,
3797
3798
<var> processRequestEndOfBody</var> must be an algorithm accepting no arguments. If given,
3798
- <var> processResponse</var> must be an algorithm accepting a <a for=/>response</a> . If given,
3799
+ <var> processEarlyHintsResponse</var> must be an algorithm accepting a <a for=/>response</a> . If
3800
+ given, <var> processResponse</var> must be an algorithm accepting a <a for=/>response</a> . If given,
3799
3801
<var> processResponseEndOfBody</var> must be an algorithm accepting a <a for=/>response</a> . If
3800
3802
given, <var> processResponseConsumeBody</var> must be an algorithm accepting a <a for=/>response</a>
3801
3803
and null, failure, or a <a for=/>byte sequence</a> .
@@ -3813,6 +3815,13 @@ the request.
3813
3815
[[!HTTP-CACHING]]
3814
3816
3815
3817
<ol>
3818
+ <li>
3819
+ <p> <a for=/>Assert</a> : <var> request</var> 's <a for=request>mode</a> is "<code> navigate</code> " or
3820
+ <var> processEarlyHintsResponse</var> is null.
3821
+
3822
+ <p class=note> Processing of early hints (<a for=/>responses</a> whose <a for=response>status</a>
3823
+ is 103) is only vetted for navigations.
3824
+
3816
3825
<li><p> Let <var> taskDestination</var> be null.
3817
3826
3818
3827
<li><p> Let <var> crossOriginIsolatedCapability</var> be false.
@@ -3848,6 +3857,7 @@ the request.
3848
3857
<a for="fetch params">process request body chunk length</a> is
3849
3858
<var> processRequestBodyChunkLength</var> ,
3850
3859
<a for="fetch params">process request end-of-body</a> is <var> processRequestEndOfBody</var> ,
3860
+ <a for="fetch params">process early hints response</a> is <var> processEarlyHintsResponse</var> ,
3851
3861
<a for="fetch params">process response</a> is <var> processResponse</var> ,
3852
3862
<a for="fetch params">process response consume body</a> is <var> processResponseConsumeBody</var> ,
3853
3863
<a for="fetch params">process response end-of-body</a> is <var> processResponseEndOfBody</var> ,
@@ -5482,22 +5492,41 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
5482
5492
<a for=request>body</a> cannot be recreated and that is why the buffer is needed.
5483
5493
</div>
5484
5494
5485
- <li><p> Set <var> timingInfo</var> 's
5486
- <a for="fetch timing info">final network-response start time</a> to the
5487
- <a for=/>coarsened shared current time</a> given <var> fetchParams</var> 's
5488
- <a for="fetch params">cross-origin isolated capability</a> , immediately after the user agent's
5489
- HTTP parser receives the first byte of the response (e.g., frame header bytes for HTTP/2 or
5490
- response status line for HTTP/1.x).
5495
+ <li>
5496
+ <p> While true:
5491
5497
5492
- <li><p> Wait until all the <a for=/>headers</a> are transmitted.
5498
+ <ol>
5499
+ <li><p> If <var> timingInfo</var> 's
5500
+ <a for="fetch timing info">final network-response start time</a> is 0, then set
5501
+ <var> timingInfo</var> 's <a for="fetch timing info">final network-response start time</a> to
5502
+ <a for=/>coarsened shared current time</a> given <var> fetchParams</var> 's
5503
+ <a for="fetch params">cross-origin isolated capability</a> , immediately after the user
5504
+ agent's HTTP parser receives the first byte of the response (e.g., frame header bytes for
5505
+ HTTP/2 or response status line for HTTP/1.x).
5493
5506
5494
- <li>
5495
- <p> Any <a for=/>responses</a> whose <a for=response>status</a> is in the range 100 to 199,
5496
- inclusive, and is not 101, are to be ignored, except for the purposes of setting
5497
- <var> timingInfo</var> 's <a for="fetch timing info">final network-response start time</a> above.
5507
+ <li><p> Wait until all the HTTP response headers are transmitted.
5508
+
5509
+ <li><p> Let <var> status</var> be the HTTP response's status code.
5510
+
5511
+ <li>
5512
+ <p> If <var> status</var> is in the range 100 to 199, inclusive:
5513
+
5514
+ <ol>
5515
+ <li><p> If <var> status</var> is 101, <a for=iteration>break</a> .
5498
5516
5499
- <p class="note no-backref"> These kind of <a for=/>responses</a> are eventually followed by a
5500
- "final" <a for=/>response</a> .
5517
+ <li><p> If <var> status</var> is 103 and <var> fetchParams</var> 's
5518
+ <a for="fetch params">process early hints response</a> is non-null, then
5519
+ <a>queue a fetch task</a> to run <var> fetchParams</var> 's
5520
+ <a for="fetch params">process early hints response</a> , with <a for=/>response</a> .
5521
+
5522
+ <li><p> <a for=iteration>Continue</a> .
5523
+ </ol>
5524
+
5525
+ <p class=note> These kind of HTTP responses are eventually followed by a "final" HTTP
5526
+ response.
5527
+
5528
+ <li><p> <a for=iteration>Break</a> .
5529
+ </ol>
5501
5530
</ul>
5502
5531
5503
5532
<p class=note> The exact layering between Fetch and HTTP still needs to be sorted through and
@@ -8101,6 +8130,11 @@ in a <a for=/>parallel queue</a> if <a for=fetch><i>useParallelQueue</i></a> is
8101
8130
<dd><p> Takes an algorithm that will be passed nothing. Indicates <a for=/>request</a> 's
8102
8131
<a for=request>body</a> has been transmitted. Most standards will not need this.
8103
8132
8133
+ <dt> <a for=fetch><i>processEarlyHintsResponse</i></a>
8134
+ <dd><p> Takes an algorithm that will be passed a <a for=/>response</a> (whose
8135
+ <a for=response>status</a> is 103). Can only be used for navigations as defined by
8136
+ <cite> HTML</cite> . [[HTML]]
8137
+
8104
8138
<dt> <a for=fetch><i>processResponse</i></a>
8105
8139
<dd><p> Takes an algorithm that will be passed a <a for=/>response</a> . Indicates
8106
8140
<a for=/>response</a> 's <a for=response>header list</a> has been received and initialized. This
0 commit comments