@@ -2757,8 +2757,12 @@ not <a for=Document>fully active</a>. It has the following <a for=struct>items</
2757
2757
<dt> <dfn for="deferred fetch record">request</dfn>
2758
2758
<dd> A <a for=/>request</a> .
2759
2759
2760
- <dt> <dfn for="deferred fetch record">done</dfn> (default false)
2761
- <dd> A boolean.
2760
+ <dt> <dfn for="deferred fetch record">notify invoked</dfn>
2761
+ <dd> An algorithm accepting no arguments.
2762
+
2763
+ <dt> <dfn for="deferred fetch record">invoke state</dfn> (default "<code> pending</code> ")
2764
+ <dd> "<code> pending</code> ", "<code> fetching</code> ", "<code> done</code> ", or
2765
+ "<code> aborted</code> ".
2762
2766
</dl>
2763
2767
2764
2768
<p> Each <a>navigable container</a> has an associated number
@@ -6765,10 +6769,9 @@ sources, specifically task sources that can result in running scripts such as th
6765
6769
<a method><code>fetchLater()</code></a> call before running any scripts that might depend on it.
6766
6770
6767
6771
<div algorithm>
6768
- <p> To <dfn>queue a deferred fetch</dfn> given a <a for=/>request</a> <var> request</var> , a
6769
- <a for=fetch>fetch group</a> <var> fetchGroup</var> , a null or {{DOMHighResTimeStamp}}
6770
- <var> activateAfter</var> , and <var> onActivatedWithoutTermination</var> , which is an algorithm that
6771
- takes no arguments:
6772
+ <p> To <dfn>queue a deferred fetch</dfn> given a <a for=/>request</a> <var> request</var> , a null or
6773
+ {{DOMHighResTimeStamp}} <var> activateAfter</var> , and <var> onActivatedWithoutTermination</var> ,
6774
+ which is an algorithm that takes no arguments:
6772
6775
6773
6776
<ol>
6774
6777
<li><p> <a>Populate request from client</a> given <var> request</var> .
@@ -6778,12 +6781,24 @@ takes no arguments:
6778
6781
<li><p> Set <var> request</var> 's <a for=request>keepalive</a> to true.
6779
6782
6780
6783
<li><p> Let <var> deferredRecord</var> be a new <a>deferred fetch record</a> whose
6781
- <a for="deferred fetch record">request</a> is <var> request</var> .
6784
+ <a for="deferred fetch record">request</a> is <var> request</var> ,
6785
+ <a for="deferred fetch record">notify invoked</a> is
6786
+ <var> onActivatedWithoutTermination</var> .
6787
+
6788
+ <li><p> <a for=list>Append</a> <var> deferredRecord</var> to <var> document</var> 's
6789
+ <a>fetch group</a> 's <a for="fetch group">deferred fetch records</a> .
6790
+
6791
+ <li><p> Let <var> controlDocument</var> be <var> document</var> 's
6792
+ <a>deferred-fetch control document</a> .
6782
6793
6783
6794
<li>
6784
- <p> <a for=list>Append</a> <var> deferredRecord</var> to <var> fetchGroup</var> 's
6795
+ <p> If <var> controlDocument</var> is not <var> document</var> , then <a for=list>append</a>
6796
+ <var> deferredRecord</var> to <var> controlDocument</var> 's <a>deferred-fetch control document</a>' s
6785
6797
<a for="fetch group">deferred fetch records</a> .
6786
6798
6799
+ <p class=note> This ensures that the deferred fetch is counted towards the control document's
6800
+ quota if its request is still in flight after the <a>fetch group</a> has been terminated.
6801
+
6787
6802
<li>
6788
6803
<p> If <var> activateAfter</var> is non-null, then run the following steps <a>in parallel</a> :</p>
6789
6804
@@ -6800,11 +6815,7 @@ takes no arguments:
6800
6815
"<code> hidden</code> " <a for=Document>visibility state</a> for a long period of time.
6801
6816
</ul>
6802
6817
6803
- <li><p> If the result of calling <a>process a deferred fetch</a> given <var> deferredRecord</var>
6804
- returns true, then <a>queue a global task</a> on the <a>deferred fetch task source</a> with
6805
- <var> request</var> 's <a for=request>client</a>' s
6806
- <a for="environment settings object">global object</a> to run
6807
- <var> onActivatedWithoutTermination</var> .
6818
+ <li><p> <a data-lt="process a deferred fetch">Process</a> <var> deferredRecord</var> .
6808
6819
</ol>
6809
6820
</li>
6810
6821
@@ -6848,14 +6859,21 @@ takes no arguments:
6848
6859
<div algorithm>
6849
6860
<p> To <dfn>process a deferred fetch</dfn> <var> deferredRecord</var> :
6850
6861
<ol>
6851
- <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">done </a> is true, then
6852
- return false .
6862
+ <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state </a> is not
6863
+ " <code> pending </code> ", then return .
6853
6864
6854
- <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">done</a> to true.
6865
+ <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> to
6866
+ "<code> fetching</code> ".
6855
6867
6856
- <li><p> <a for=/>Fetch</a> <var> deferredRecord</var> 's <a for="deferred fetch record">request</a> .
6868
+ <li><p> <a for=/>Fetch</a> <var> deferredRecord</var> 's <a for="deferred fetch record">request</a> ,
6869
+ with <a for=fetch><i>processRequestEndOfBody</i></a> set to the following step: set
6870
+ <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> to
6871
+ "<code> done</code> ".
6857
6872
6858
- <li><p> Return true.
6873
+ <li><p> <a>Queue a global task</a> on the <a>deferred fetch task source</a> with
6874
+ <var> request</var> 's <a for=request>client</a>' s
6875
+ <a for="environment settings object">global object</a> to run <var> deferredRecord</var> 's
6876
+ <a for="deferred fetch record">notify invoked</a> .
6859
6877
</ol>
6860
6878
</div>
6861
6879
@@ -7007,9 +7025,12 @@ descendants share a quota of 384 kibibytes. That value is computed as such:
7007
7025
7008
7026
<div algorithm>
7009
7027
<p> To get the <dfn>available deferred-fetch quota</dfn> given a {{Document}}
7010
- <var> controlDocument </var> and an <a for=/>origin</a> -or-null <var> origin</var> :
7028
+ <var> document </var> and an <a for=/>origin</a> -or-null <var> origin</var> :
7011
7029
7012
7030
<ol>
7031
+ <li><p> Let <var> controlDocument</var> be <var> document</var> 's
7032
+ <a>deferred-fetch control document</a> .
7033
+
7013
7034
<li><p> Let <var> navigable</var> be <var> controlDocument</var> 's <a>node navigable</a> .
7014
7035
7015
7036
<li><p> Let <var> isTopLevel</var> be true if <var> controlDocument</var> 's <a>node navigable</a> is a
@@ -7073,6 +7094,9 @@ descendants share a quota of 384 kibibytes. That value is computed as such:
7073
7094
<a for="fetch group">deferred fetch records</a> :</p>
7074
7095
7075
7096
<ol>
7097
+ <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> is
7098
+ "<code> done</code> " or "<code> aborted</code> ", then <a for=iteration>continue</a> .
7099
+
7076
7100
<li><p> Let <var> requestLength</var> be the <a>total request length</a> of
7077
7101
<var> deferredRecord</var> 's <a for="deferred fetch record">request</a> .
7078
7102
@@ -9093,27 +9117,20 @@ method steps are:
9093
9117
<li><p> Let <var> controlDocument</var> be <var> request</var> 's <a for=request>client</var>' s
9094
9118
<a>deferred-fetch control document</a> .
9095
9119
9096
- <li><p> If the <a>available deferred-fetch quota</a> given <var> controlDocument </var> and
9097
- <var> request</var> 's <a for=request>URL</a >' s <a for=url>origin </a> is less than
9098
- <var> request</var> 's <a>total request length</a> , then throw a " {{QuotaExceededError}} "
9099
- {{DOMException}} .
9120
+ <li><p> If the <a>available deferred-fetch quota</a> given <var> request </var> 's
9121
+ <a for= request>client </var> and <var>request</var >'s <a for=request>URL </a> 's
9122
+ <a for=url>origin</a> is less than < var> request</var> 's <a>total request length</a> , then throw a
9123
+ " {{QuotaExceededError}} " {{DOMException}} .
9100
9124
9101
9125
<li><p> Let <var> activated</var> be false.
9102
9126
9103
9127
<li><p> Let <var> deferredRecord</var> be the result of calling <a>queue a deferred fetch</a> given
9104
- <var> request</var> , <var> controlDocument</var> 's <a>fetch group</a> , <var> activateAfter</var> , and
9105
- the following step: set <var> activated</var> to true.
9106
-
9107
- <li>
9108
- <p> <a for=AbortSignal lt=add>Add the following abort steps</a> to <var> requestObject</var> 's
9109
- <a for=Request>signal</a> :
9110
-
9111
- <ol>
9112
- <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">done</a> to true.
9128
+ <var> request</var> , <var> activateAfter</var> , and the following step: set <var> activated</var> to
9129
+ true.
9113
9130
9114
- <li><p> <a for=list>Remove </a> <var> deferredRecord </var> from <var> controlDocument </var> 's
9115
- <a for=fetch>fetch group </a> 's <a for="fetch group">deferred fetch records</a> .
9116
- </ol>
9131
+ <li><p> <a for=AbortSignal lt=add>Add the following abort steps </a> to <var> requestObject </var> 's
9132
+ <a for=Request>signal </a> : <li><p> Set <var> deferredRecord </var> 's
9133
+ <a for="deferred fetch record">invoke state</a> to " <code> aborted </code> ".
9117
9134
9118
9135
<li><p> Return a new {{FetchLaterResult}} whose
9119
9136
<a for=FetchLaterResult>activated getter steps</a> are to return <var> activated</var> .
0 commit comments