@@ -2753,7 +2753,7 @@ a <a for=/>list</a> of <a data-lt="deferred fetch record">deferred fetch records
2753
2753
<hr>
2754
2754
2755
2755
<p> A <dfn export>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed
2756
- to invoke a fetch at a later time, e.g., when a <code> Document</code> object is unloaded or becomes
2756
+ to invoke a fetch at a later time, e.g., when a {{ Document}} object is unloaded or becomes
2757
2757
not <a for=Document>fully active</a> . It has the following <a for=struct>items</a> :
2758
2758
2759
2759
<dl>
@@ -2765,7 +2765,7 @@ not <a for=Document>fully active</a>. It has the following <a for=struct>items</
2765
2765
<p> "<code> deferred</code> ", "<code> aborted</code> ", or "<code> activated</code> ".
2766
2766
2767
2767
<p class=note> This value can be modified <a>in parallel</a> . There could be a race condition where
2768
- the <code> Document</code> object's <a for=/>event loop</a> might read it as
2768
+ the {{ Document}} object's <a for=/>event loop</a> might read it as
2769
2769
"<code> deferred</code> " at the same time that it is changed to "<code> activated</code> ". User
2770
2770
agents can mitigate this race condition in an <a>implementation-defined</a> manner.
2771
2771
</dl>
@@ -6754,30 +6754,15 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
6754
6754
6755
6755
<h3 id=deferred-fetch>Deferred fetching</h3>
6756
6756
6757
- <p> Deferred fetches allow callers to request that a fetch is invoked at the latest possible moment,
6757
+ <p> Deferred fetching allows callers to request that a fetch is invoked at the latest possible moment,
6758
6758
i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a> , or after a timeout.
6759
6759
6760
6760
<div algorithm>
6761
- <p> To <dfn>request a deferred fetch</dfn> given a
6761
+ <p> To <dfn>queue a deferred fetch</dfn> given a
6762
6762
<a for=/>request</a> <var> request</var> and a null or {{DOMHighResTimeStamp}}
6763
6763
<var> activateAfter</var> (default null):
6764
6764
6765
6765
<ol>
6766
- <li><p> If <var> request</var> 's <a for=request>client</a> is not a <a>fully active</a>
6767
- {{Document}} , then throw an "{{InvalidStateError}} " {{DOMException}} .
6768
-
6769
- <li><p> If <var> request</var> 's <a for=request>URL</a>' s <a for=url>scheme</a> is not an
6770
- <a>HTTP(S) scheme</a> , then throw a {{TypeError}} .
6771
-
6772
- <li><p> If <var> request</var> 's <a for=request>URL</a> is not a
6773
- <a>potentially trustworthy url</a> , then throw a "{{SecurityError}} " {{DOMException}} .
6774
-
6775
- <li><p> Let <var> totalRequestLength</var> be <var> request</var> 's <a>total request length</a>
6776
-
6777
- <li><p> If the <a>available deferred-fetch quota</a> given <var> request</var> 's
6778
- <a for=request>client</a> and <var> request</var> 's <a for=request>URL</a>' s <a for=url>origin</a>
6779
- is less than <var> totalRequestLength</var> , then throw a "{{QuotaExceededError}} " {{DOMException}} .
6780
-
6781
6766
<li><p> Set <var> request</var> 's <a for=request>service-workers mode</a> to "<code> none</code> ".
6782
6767
6783
6768
<li><p> Set <var> request</var> 's <a for=request>keepalive</a> to true.
@@ -6796,7 +6781,7 @@ i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after
6796
6781
<li><p> The user agent should wait until <var> activateAfter</var> milliseconds have passed,
6797
6782
or until the user agent has a reason to believe that it is about to lose the opportunity to
6798
6783
execute scripts, e.g., when the browser is moved to the background, or when <var> request</var> 's
6799
- <a for=request>client</a> is a <code> Document</code> that had a "<code> hidden</code> "
6784
+ <a for=request>client</a> is a {{ Document}} that had a "<code> hidden</code> "
6800
6785
<a for=Document>visibility state</a> for a long period of time.
6801
6786
6802
6787
<li><p> The user agent may wait for a further <a>implementation-defined</a> <a>duration</a> , e.g.,
@@ -6819,7 +6804,7 @@ i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after
6819
6804
<a for=request>URL</a> , <a lt="URL serializer">serialized</a> with
6820
6805
[=URL serializer/exclude fragment=] set to true.
6821
6806
6822
- <li><p> <a for=list>For each</a> (<var> name</var> , <var> value</var> ) in <var> request</var> 's
6807
+ <li><p> <a for=list>For each</a> (<var> name</var> , <var> value</var> ) of <var> request</var> 's
6823
6808
<a for=request>header list</a> , increment <var> totalRequestLength</var> by <var> name</var> 's
6824
6809
<a for="byte sequence">length</a> + <var> value</var> 's <a for="byte sequence">length</a> .
6825
6810
@@ -6869,18 +6854,27 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6869
6854
6870
6855
<p> This specification defined a <a>policy-controlled feature</a> identified by the string
6871
6856
<dfn for=PermissionPolicy enum-value>"deferred-fetch"</dfn> . Its
6872
- <a for="policy-controlled feature">default allowlist</a> is ` ' self' ` .
6857
+ <a for="policy-controlled feature">default allowlist</a> is " <code> self</code> " .
6873
6858
6874
6859
<p> This specification defined a <a>policy-controlled feature</a> identified by the string
6875
6860
<dfn for=PermissionPolicy enum-value>"deferred-fetch-minimal"</dfn> . Its
6876
- <a for="policy-controlled feature">default allowlist</a> is `*` .
6861
+ <a for="policy-controlled feature">default allowlist</a> is " <code> * </code> " .
6877
6862
6878
6863
<p> The <dfn>optional subframe deferred-fetch quota</dfn> is 64 kibibytes.
6879
6864
<p> The <dfn>minimal subframe deferred-fetch quota</dfn> is 8 kibibytes.
6880
6865
<p> The <dfn>deferred-fetch delegated quota</dfn> is 128 kibibytes.
6881
6866
6882
6867
<div algorithm>
6883
- <p> To get the <dfn>available deferred-fetch quota</dfn> given a <code> Document</code>
6868
+ <p> Two {{Document}} s <var> a</var> and <var> b</var> are said to
6869
+ <dfn>share deferred-fetch quota</dfn> if <var> a</var> 's
6870
+ <a>relevant agent</a> is <var> b</var> 's <a>relevant agent</a>, and <var>a</var>' s
6871
+ <a for=Document>URL</a> 's <a for=url>origin</a> is <a>same origin</a> with <var>b</var>' s
6872
+ <a for=Document>URL</a> 's <a for=url>origin</a> .
6873
+ </div>
6874
+
6875
+
6876
+ <div algorithm>
6877
+ <p> To get the <dfn>available deferred-fetch quota</dfn> given a {{Document}}
6884
6878
<var> document</var> and an <a for=/>origin</a> -or-null <var> origin</var> :
6885
6879
6886
6880
<ol>
@@ -6909,6 +6903,9 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6909
6903
<li>
6910
6904
<p> If <var> otherDocument</var> 's <a>node navigable</a> is a
6911
6905
<a for=/>top-level traversable</a> , then:
6906
+
6907
+ <p class=note> Initialize the quota from the top-level traversable.
6908
+
6912
6909
<ol>
6913
6910
<li><p> Assert: <var> quota</var> is zero.
6914
6911
@@ -6926,8 +6923,14 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6926
6923
</ol>
6927
6924
6928
6925
<li>
6926
+ <p> Otherwise,
6927
+
6928
+ <p class=note> This is a subframe, check if it inherits quota from its parent container based
6929
+ on permissions policy. This would only be the case if the subframe and its parent do not share
6930
+ quota, as quota is either shared or delegated.
6931
+
6929
6932
<ol>
6930
- <li><p> Let <var> otherContainer</var> be <var> otherDocument </var> 's <a>node navigable</a >' s
6933
+ <li><p> Let <var> otherContainer</var> be <var> otherNavigable </var> 's
6931
6934
<a>navigable container</a> .
6932
6935
6933
6936
<li>
@@ -6951,19 +6954,18 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6951
6954
</ol>
6952
6955
6953
6956
<li>
6954
- <p> <a for=list>For each</a> <a>deferred fetch record</a> <var> deferredRecord</var> in
6957
+ <p> <a for=list>For each</a> <a>deferred fetch record</a> <var> deferredRecord</var> of
6955
6958
<var> otherDocument</var> 's <a for=fetch>fetch group</a>' s
6956
6959
<a for="fetch group">deferred fetch records</a> :</p>
6957
6960
<ol>
6958
- <li><p> Let <var> length </var> be the <a>total request length</a> of
6961
+ <li><p> Let <var> requestLength </var> be the <a>total request length</a> of
6959
6962
<var> deferredRecord</var> 's <a for="deferred fetch record">request</a> .
6960
6963
6961
- <li><p> Decrement <var> quota</var> by <var> length </var> .
6964
+ <li><p> Decrement <var> quota</var> by <var> requestLength </var> .
6962
6965
6963
- <li><p> If <var> origin</var> is not null, and <var> deferredRecord</var> 's
6964
- <a for="deferred fetch record">request</a> 's <a for=request>URL</a>' s <a for=url>origin</a>
6965
- is <a>same origin</a> with <var> origin</var> , then decrement <var> quotaForOrigin</var> by
6966
- <var> length</var> .
6966
+ <li><p> If <var> deferredRecord</var> 's <a for="deferred fetch record">request</a>' s
6967
+ <a for=request>URL</a> 's <a for=url>origin</a> is <a>same origin</a> with <var> origin</var> ,
6968
+ then decrement <var> quotaForOrigin</var> by <var> requestLength</var> .
6967
6969
</ol>
6968
6970
</ol>
6969
6971
@@ -6988,65 +6990,64 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6988
6990
6989
6991
<div algorithm>
6990
6992
<p> To <dfn export>reserve deferred-fetch quota</dfn> for a <a>navigable container</a>
6991
- <var> container</var> given an <a for=/>origin</a> <var> originToNavigateTo</var> , set
6992
- <var> container</var> 's <a>reserved deferred-fetch quota</a> to the result of running the steps
6993
- corresponding to the first matching statement:
6993
+ <var> container</var> given an <a for=/>origin</a> <var> originToNavigateTo</var> :
6994
+
6995
+ <p class=note> This is called when the container document initiates a navigation. It potentially
6996
+ reserves either 64kb or 8kb of quota for the frame, if it doesn't <a>share deferred-fetch quota</a>
6997
+ with the container and the permissions policy allow. It is not observable to the cotnainer document
6998
+ whether the reserved quota was used in practice.
6999
+ This algorithm assumes that the container's document might delegate quota to the navigated frame,
7000
+ and the reserved quota would only apply in that case, and would be ignored if it ends up being
7001
+ shared.
6994
7002
6995
- <dl class=switch >
6996
- <dt> The <a data-lt="define an inherited policy for feature in container">inherited policy</a>
7003
+ <ol >
7004
+ <li><p> If the <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6997
7005
for {{PermissionPolicy/"deferred-fetch"}} , <var> container</var> and <var> originToNavigateTo</var>
6998
7006
is <code> Enabled</code> , and the <a>available deferred-fetch quota</a> for
6999
7007
<var> container</var> 's <a>container document</a> is equal or greater than
7000
- <a>optional subframe deferred-fetch quota</a>
7001
- <dd><p> Return <a>optional subframe deferred-fetch quota</a> .
7002
-
7003
- <dt><var> container</var> 's <a>node document</a> and <var>container</var>' s <a>node navigable</a> 's
7004
- <a for=navigable>top-level traversable</a> 's <a>active document</a>
7005
- <a>share deferred-fetch quota</a> , and the
7006
- <a data-lt="define an inherited policy for feature in container">inherited policy</a>
7007
- for {{PermissionPolicy/"deferred-fetch-minimal"}} , <var> container</var> and
7008
- <var> originToNavigateTo</var> is <code> Enabled</code>
7009
- <dd>
7008
+ <a>optional subframe deferred-fetch quota</a> , then set <var> container</var> 's
7009
+ <a>reserved deferred-fetch quota</a> to <a>optional subframe deferred-fetch quota</a> .
7010
+
7011
+ <li>
7012
+ <p> Otherwise, if the
7013
+ <a data-lt="define an inherited policy for feature in container">inherited policy</a> for
7014
+ {{PermissionPolicy/"deferred-fetch-minimal"}} , <var> container</var> and
7015
+ <var> originToNavigateTo</var> is <code> Enabled</code> , then:
7010
7016
<ol>
7011
7017
<li><p> Let <var> delegatedQuota</var> be <a>deferred-fetch delegated quota</a> .
7012
7018
7013
7019
<li>
7014
- <p> <a for=list>For each</a> <var> navigable</var> in <var> container</var> 's
7020
+ <p> <a for=list>For each</a> <var> navigable</var> of <var> container</var> 's
7015
7021
<a>node navigable</a> 's <a for=navigable>top-level traversable</a>' s
7016
7022
<a>inclusive descendant navigables</a> who meets all of the following conditions:
7017
7023
<ul class=brief>
7018
7024
<li><p><var> navigable</var> is not <var> container</var> 's <a>content navigable</a> .
7019
7025
7020
- <li><p><var> navigable</var> 's <a>active document</a> and <var>container </var>' s
7021
- <a>node navigable</a> 's <a for=navigable>top-level traversable </a> do not
7026
+ <li><p><var> navigable</var> 's <a>active document</a> and <var>navigable </var>' s
7027
+ <a for= navigable>top-level traversable </a> 's <a>active document </a> do not
7022
7028
<a>share deferred-fetch quota</a> .
7023
7029
7024
- <li><p><var> navigable</var> 's <var>container</var>' s <a>reserved deferred-fetch quota</a>
7030
+ <li><p><var> navigable</var> 's <a>navigable container</a>' s <a>node document</a> and
7031
+ <var> navigable</var> 's <a for=navigable>top-level traversable</a>' s <a>active document</a>
7032
+ <a>share deferred-fetch quota</a> .
7033
+
7034
+ <li><p><var> navigable</var> 's <a>navigable container</a>' s <a>reserved deferred-fetch quota</a>
7025
7035
is <a>minimal subframe deferred-fetch quota</a> .
7026
- </ul> ,
7036
+ </ul>
7027
7037
7028
- <p> Decrement <var> delegatedQuota</var> by <a>minimal subframe deferred-fetch quota</a> .
7038
+ <p> Decrement <var> delegatedQuota</var> by <a>minimal subframe deferred-fetch quota</a> .
7029
7039
7030
7040
<li><p> If <var> delegatedQuota</var> is less than <a>minimal subframe deferred-fetch quota</a> ,
7031
- then return zero.
7041
+ then set <var> container </var> 's <a>reserved deferred-fetch quota</a> to zero.
7032
7042
7033
- <li><p> Return <a>minimal subframe deferred-fetch quota</a> .
7043
+ <li><p> Otherwise, set <var> container</var> 's <a>reserved deferred-fetch quota</a> to
7044
+ <a>minimal subframe deferred-fetch quota</a> .
7034
7045
</ol>
7035
7046
7036
- <dt> Otherwise
7037
- <dd><p> Return zero.
7038
- </dl>
7047
+ <li><p> Otherwise, set <var> container</var> 's <a>reserved deferred-fetch quota</a> to zero.
7039
7048
7040
7049
</div>
7041
7050
7042
- <div algorithm>
7043
- <p> Two <code> Documents</code> <var> a</var> and <var> b</var> are said to
7044
- <dfn>share deferred-fetch quota</dfn> if <var> a</var> 's
7045
- <a>relevant agent</a> is <var> b</var> 's <a>relevant agent</a>, and <var>a</var>' s
7046
- <a for=Document>URL</a> 's <a for=url>origin</a> is <a>same origin</a> with var>b</var>' s
7047
- <a for=Document>URL</a> 's <a for=url>origin</a> .
7048
- </div>
7049
-
7050
7051
7051
7052
<h2 id=fetch-api>Fetch API</h2>
7052
7053
@@ -8953,8 +8954,26 @@ method steps are:
8953
8954
8954
8955
<li><p> If <var> activateAfter</var> is less than 0, then throw a {{RangeError}} .
8955
8956
8957
+ <li><p> If <var> request</var> 's <a for=request>URL</a>' s <a for=url>scheme</a> is not an
8958
+ <a>HTTP(S) scheme</a> , then throw a {{TypeError}} .
8959
+
8960
+ <li><p> If <var> request</var> 's <a for=request>client</a> is not a <a>fully active</a>
8961
+ {{Document}} , then throw an "{{InvalidStateError}} " {{DOMException}} .
8962
+
8963
+ <li><p> If <var> request</var> 's <a for=request>URL</a> is not a
8964
+ <a>potentially trustworthy url</a> , then throw a "{{SecurityError}} " {{DOMException}} .
8965
+
8966
+ <li><p><li><p> If <var> request</var> 's
8967
+ <a for=request>body</a> is not null, and <var> request</var> 's
8968
+ <a for=request>body</a> <a for=body>source</a> is null, then throw a {{TypeError}} .
8969
+
8970
+ <li><p> If the <a>available deferred-fetch quota</a> given <var> request</var> 's
8971
+ <a for=request>client</a> and <var> request</var> 's <a for=request>URL</a>' s <a for=url>origin</a>
8972
+ is less than <var> request</var> 's <a>total request length</a> , then throw a
8973
+ "{{QuotaExceededError}} " {{DOMException}} .
8974
+
8956
8975
<li><p> Let <var> deferredRecord</var> be the result of calling
8957
- <a>request a deferred fetch</a> given <var> request</var> and <var> activateAfter</var> .
8976
+ <a>queue a deferred fetch</a> given <var> request</var> and <var> activateAfter</var> .
8958
8977
8959
8978
<li>
8960
8979
<p> <a for=AbortSignal lt=add>Add the following abort steps</a> to <var> requestObject</var> 's
0 commit comments