@@ -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
@@ -6761,10 +6765,9 @@ sources, specifically task sources that can result in running scripts such as th
6761
6765
<a method><code>fetchLater()</code></a> call before running any scripts that might depend on it.
6762
6766
6763
6767
<div algorithm>
6764
- <p> To <dfn>queue a deferred fetch</dfn> given a <a for=/>request</a> <var> request</var> , a
6765
- <a for=fetch>fetch group</a> <var> fetchGroup</var> , a null or {{DOMHighResTimeStamp}}
6766
- <var> activateAfter</var> , and <var> onActivatedWithoutTermination</var> , which is an algorithm that
6767
- takes no arguments:
6768
+ <p> To <dfn>queue a deferred fetch</dfn> given a <a for=/>request</a> <var> request</var> , a null or
6769
+ {{DOMHighResTimeStamp}} <var> activateAfter</var> , and <var> onActivatedWithoutTermination</var> ,
6770
+ which is an algorithm that takes no arguments:
6768
6771
6769
6772
<ol>
6770
6773
<li><p> <a>Populate request from client</a> given <var> request</var> .
@@ -6774,12 +6777,24 @@ takes no arguments:
6774
6777
<li><p> Set <var> request</var> 's <a for=request>keepalive</a> to true.
6775
6778
6776
6779
<li><p> Let <var> deferredRecord</var> be a new <a>deferred fetch record</a> whose
6777
- <a for="deferred fetch record">request</a> is <var> request</var> .
6780
+ <a for="deferred fetch record">request</a> is <var> request</var> ,
6781
+ <a for="deferred fetch record">notify invoked</a> is
6782
+ <var> onActivatedWithoutTermination</var> .
6783
+
6784
+ <li><p> <a for=list>Append</a> <var> deferredRecord</var> to <var> document</var> 's
6785
+ <a>fetch group</a> 's <a for="fetch group">deferred fetch records</a> .
6786
+
6787
+ <li><p> Let <var> controlDocument</var> be <var> document</var> 's
6788
+ <a>deferred-fetch control document</a> .
6778
6789
6779
6790
<li>
6780
- <p> <a for=list>Append</a> <var> deferredRecord</var> to <var> fetchGroup</var> 's
6791
+ <p> If <var> controlDocument</var> is not <var> document</var> , then <a for=list>append</a>
6792
+ <var> deferredRecord</var> to <var> controlDocument</var> 's <a>deferred-fetch control document</a>' s
6781
6793
<a for="fetch group">deferred fetch records</a> .
6782
6794
6795
+ <p class=note> This ensures that the deferred fetch is counted towards the control document's
6796
+ quota if its request is still in flight after the <a>fetch group</a> has been terminated.
6797
+
6783
6798
<li>
6784
6799
<p> If <var> activateAfter</var> is non-null, then run the following steps <a>in parallel</a> :</p>
6785
6800
@@ -6796,11 +6811,7 @@ takes no arguments:
6796
6811
"<code> hidden</code> " <a for=Document>visibility state</a> for a long period of time.
6797
6812
</ul>
6798
6813
6799
- <li><p> If the result of calling <a>process a deferred fetch</a> given <var> deferredRecord</var>
6800
- returns true, then <a>queue a global task</a> on the <a>deferred fetch task source</a> with
6801
- <var> request</var> 's <a for=request>client</a>' s
6802
- <a for="environment settings object">global object</a> to run
6803
- <var> onActivatedWithoutTermination</var> .
6814
+ <li><p> <a data-lt="process a deferred fetch">Process</a> <var> deferredRecord</var> .
6804
6815
</ol>
6805
6816
</li>
6806
6817
@@ -6844,14 +6855,21 @@ takes no arguments:
6844
6855
<div algorithm>
6845
6856
<p> To <dfn>process a deferred fetch</dfn> <var> deferredRecord</var> :
6846
6857
<ol>
6847
- <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">done </a> is true, then
6848
- return false .
6858
+ <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state </a> is not
6859
+ " <code> pending </code> ", then return .
6849
6860
6850
- <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">done</a> to true.
6861
+ <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> to
6862
+ "<code> fetching</code> ".
6851
6863
6852
- <li><p> <a for=/>Fetch</a> <var> deferredRecord</var> 's <a for="deferred fetch record">request</a> .
6864
+ <li><p> <a for=/>Fetch</a> <var> deferredRecord</var> 's <a for="deferred fetch record">request</a> ,
6865
+ with <a for=fetch><i>processRequestEndOfBody</i></a> set to the following step: set
6866
+ <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> to
6867
+ "<code> done</code> ".
6853
6868
6854
- <li><p> Return true.
6869
+ <li><p> <a>Queue a global task</a> on the <a>deferred fetch task source</a> with
6870
+ <var> request</var> 's <a for=request>client</a>' s
6871
+ <a for="environment settings object">global object</a> to run <var> deferredRecord</var> 's
6872
+ <a for="deferred fetch record">notify invoked</a> .
6855
6873
</ol>
6856
6874
</div>
6857
6875
@@ -7003,9 +7021,12 @@ descendants share a quota of 384 kibibytes. That value is computed as such:
7003
7021
7004
7022
<div algorithm>
7005
7023
<p> To get the <dfn>available deferred-fetch quota</dfn> given a {{Document}}
7006
- <var> controlDocument </var> and an <a for=/>origin</a> -or-null <var> origin</var> :
7024
+ <var> document </var> and an <a for=/>origin</a> -or-null <var> origin</var> :
7007
7025
7008
7026
<ol>
7027
+ <li><p> Let <var> controlDocument</var> be <var> document</var> 's
7028
+ <a>deferred-fetch control document</a> .
7029
+
7009
7030
<li><p> Let <var> navigable</var> be <var> controlDocument</var> 's <a>node navigable</a> .
7010
7031
7011
7032
<li><p> Let <var> isTopLevel</var> be true if <var> controlDocument</var> 's <a>node navigable</a> is a
@@ -7069,6 +7090,9 @@ descendants share a quota of 384 kibibytes. That value is computed as such:
7069
7090
<a for="fetch group">deferred fetch records</a> :</p>
7070
7091
7071
7092
<ol>
7093
+ <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">invoke state</a> is
7094
+ "<code> done</code> " or "<code> aborted</code> ", then <a for=iteration>continue</a> .
7095
+
7072
7096
<li><p> Let <var> requestLength</var> be the <a>total request length</a> of
7073
7097
<var> deferredRecord</var> 's <a for="deferred fetch record">request</a> .
7074
7098
@@ -9085,27 +9109,20 @@ method steps are:
9085
9109
<li><p> Let <var> controlDocument</var> be <var> request</var> 's <a for=request>client</var>' s
9086
9110
<a>deferred-fetch control document</a> .
9087
9111
9088
- <li><p> If the <a>available deferred-fetch quota</a> given <var> controlDocument </var> and
9089
- <var> request</var> 's <a for=request>URL</a >' s <a for=url>origin </a> is less than
9090
- <var> request</var> 's <a>total request length</a> , then throw a " {{QuotaExceededError}} "
9091
- {{DOMException}} .
9112
+ <li><p> If the <a>available deferred-fetch quota</a> given <var> request </var> 's
9113
+ <a for= request>client </var> and <var>request</var >'s <a for=request>URL </a> 's
9114
+ <a for=url>origin</a> is less than < var> request</var> 's <a>total request length</a> , then throw a
9115
+ " {{QuotaExceededError}} " {{DOMException}} .
9092
9116
9093
9117
<li><p> Let <var> activated</var> be false.
9094
9118
9095
9119
<li><p> Let <var> deferredRecord</var> be the result of calling <a>queue a deferred fetch</a> given
9096
- <var> request</var> , <var> controlDocument</var> 's <a>fetch group</a> , <var> activateAfter</var> , and
9097
- the following step: set <var> activated</var> to true.
9098
-
9099
- <li>
9100
- <p> <a for=AbortSignal lt=add>Add the following abort steps</a> to <var> requestObject</var> 's
9101
- <a for=Request>signal</a> :
9102
-
9103
- <ol>
9104
- <li><p> Set <var> deferredRecord</var> 's <a for="deferred fetch record">done</a> to true.
9120
+ <var> request</var> , <var> activateAfter</var> , and the following step: set <var> activated</var> to
9121
+ true.
9105
9122
9106
- <li><p> <a for=list>Remove </a> <var> deferredRecord </var> from <var> controlDocument </var> 's
9107
- <a for=fetch>fetch group </a> 's <a for="fetch group">deferred fetch records</a> .
9108
- </ol>
9123
+ <li><p> <a for=AbortSignal lt=add>Add the following abort steps </a> to <var> requestObject </var> 's
9124
+ <a for=Request>signal </a> : <li><p> Set <var> deferredRecord </var> 's
9125
+ <a for="deferred fetch record">invoke state</a> to " <code> aborted </code> ".
9109
9126
9110
9127
<li><p> Return a new {{FetchLaterResult}} whose
9111
9128
<a for=FetchLaterResult>activated getter steps</a> are to return <var> activated</var> .
0 commit comments