@@ -7882,21 +7882,31 @@ method steps are:
7882
7882
<ol>
7883
7883
<li><p> Set <var> locallyAborted</var> to true.
7884
7884
7885
- <li><p> <a>Abort the <code>fetch()</code> call</a> with <var> p</var> , <var> request</var> , <var> responseObject</var> ,
7886
- and <var> requestObject</var> 's <a for=Request>signal</a>' s <a for=AbortSignal>abort reason</a> .
7885
+ <li><p> <a for=/>Assert</a> : <var> controller</var> is non-null.
7887
7886
7888
- <li><p> If <var> controller</var> is not null, then <a for="fetch controller">abort</a>
7889
- <var> controller</var> with <var> requestObject</var> 's <a for=Request>signal</a>' s
7887
+ <li><p> <a for="fetch controller">Abort</a> <var> controller</var> with <var> requestObject</var> 's
7888
+ <a for=Request>signal</a> 's <a for=AbortSignal>abort reason</a> .
7889
+
7890
+ <li><p> <a>Abort the <code>fetch()</code> call</a> with <var> p</var> , <var> request</var> ,
7891
+ <var> responseObject</var> , and <var> requestObject</var> 's <a for=Request>signal</a>' s
7890
7892
<a for=AbortSignal>abort reason</a> .
7893
+ <!-- ABORT-DUPLICATION
7894
+ This step would ideally be skipped for HTTP(S) requests, except that currently the HTTP
7895
+ cache integration with streams is not as good as it can be. Unfortunately we definitely need
7896
+ to do this for about:blank and blob: & data: URLs.
7897
+
7898
+ The conceptual problem is that the underlying operation might not have been aborted by the
7899
+ time JavaScript gets a signal. See also:
7900
+ https://github.com/whatwg/dom/issues/1031#issuecomment-1233206400 -->
7891
7901
</ol>
7892
7902
7893
7903
<li>
7894
7904
<p><p> Set <var> controller</var> to the result of calling <a for=/>fetch</a> given
7895
7905
<var> request</var> and <a for=fetch><i>processResponse</i></a> given <var> response</var> being
7896
- these substeps :
7906
+ these steps :
7897
7907
7898
7908
<ol>
7899
- <li><p> If <var> locallyAborted</var> is true, terminate these substeps .
7909
+ <li><p> If <var> locallyAborted</var> is true, then abort these steps .
7900
7910
7901
7911
<li>
7902
7912
<p> If <var> response</var> 's <a for=response>aborted flag</a> is set, then:
@@ -7908,10 +7918,12 @@ method steps are:
7908
7918
7909
7919
<li><p> <a>Abort the <code>fetch()</code> call</a> with <var> p</var> , <var> request</var> ,
7910
7920
<var> responseObject</var> , and <var> deserializedError</var> .
7921
+
7922
+ <li><p> Abort these steps.
7911
7923
</ol>
7912
7924
7913
7925
<li><p> If <var> response</var> is a <a>network error</a> , then <a for=/>reject</a> <var> p</var>
7914
- with a {{TypeError}} and terminate these substeps .
7926
+ with a {{TypeError}} and abort these steps .
7915
7927
7916
7928
<li><p> Set <var> responseObject</var> to the result of <a for=Response>creating</a> a {{Response}}
7917
7929
object, given <var> response</var> , "<code> immutable</code> ", and <var> relevantRealm</var> .
@@ -7922,24 +7934,28 @@ method steps are:
7922
7934
<li><p> Return <var> p</var> .
7923
7935
</ol>
7924
7936
7925
- <p> To <dfn lt="Abort the fetch() call" export id=abort-fetch>abort a <code>fetch()</code> call</dfn> with a
7926
- <var> promise</var> , <var> request</var> , <var> responseObject</var> , and an <var> error</var> , run these steps :
7937
+ <p> To <dfn lt="Abort the fetch() call" export id=abort-fetch>abort a <code>fetch()</code> call</dfn>
7938
+ with a <var> promise</var> , <var> request</var> , <var> responseObject</var> , and an <var> error</var> :
7927
7939
7928
7940
<ol>
7929
7941
<li>
7930
7942
<p> <a for=/>Reject</a> <var> promise</var> with <var> error</var> .
7931
7943
7932
7944
<p class=note> This is a no-op if <var> promise</var> has already fulfilled.
7933
7945
7934
- <li><p> If <var> request</var> 's <a for=request>body</a> is not null and is
7946
+ <li><p> If <var> request</var> 's <a for=request>body</a> is non- null and is
7935
7947
<a for=ReadableStream>readable</a> , then <a for=ReadableStream>cancel</a> <var> request</var> 's
7936
7948
<a for=request>body</a> with <var> error</var> .
7937
7949
7938
7950
<li><p> If <var> responseObject</var> is null, then return.
7951
+ <!-- ABORT-DUPLICATION
7952
+ We might not need this and subsequent steps if we had better stream integration with the HTTP
7953
+ cache. However, about:blank and blob: & data: URLs would probably still need this as they do
7954
+ not have any cancelation logic. -->
7939
7955
7940
7956
<li><p> Let <var> response</var> be <var> responseObject</var> 's <a for=Response>response</a> .
7941
7957
7942
- <li><p> If <var> response</var> 's <a for=response>body</a> is not null and is
7958
+ <li><p> If <var> response</var> 's <a for=response>body</a> is non- null and is
7943
7959
<a for=ReadableStream>readable</a> , then <a for=ReadableStream>error</a> <var> response</var> 's
7944
7960
<a for=response>body</a> with <var> error</var> .
7945
7961
</ol>
0 commit comments