@@ -2734,10 +2734,8 @@ functionality.
2734
2734
<dfn lt="fetch record" export for="fetch group" id=concept-fetch-record>fetch records</dfn> ,
2735
2735
a <a for=/>list</a> of <a for="/" data-lt="fetch record">fetch records</a> .
2736
2736
2737
- <p> Each <a>navigable container</a> has an associated <dfn>deferred fetch policy</dfn>
2738
- ({{PermissionPolicy/"deferred-fetch"}} , {{PermissionPolicy/"deferred-fetch-minimal"}} , or
2739
- <code> Disabled</code> ). Unless
2740
- stated otherwise, it is <code> disabled</code> .
2737
+ <p> Each <a>navigable container</a> has an associated number
2738
+ <dfn>subframe reserved deferred-fetch quota</dfn> . Unless stated otherwise, it is zero.
2741
2739
2742
2740
<p> A <a for=fetch>fetch group</a> has an associated
2743
2741
<dfn export for="fetch group" id=concept-defer=fetch-record>deferred fetch records</dfn> ,
@@ -6754,7 +6752,7 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
6754
6752
</ol>
6755
6753
</div>
6756
6754
6757
- <h3 id=deferred-fetching >Deferred fetching</h3>
6755
+ <h3 id=deferred-fetch >Deferred fetching</h3>
6758
6756
6759
6757
<p> Deferred fetches allow callers to request that a fetch is invoked at the latest possible moment,
6760
6758
i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a> , or after a timeout.
@@ -6776,7 +6774,7 @@ i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after
6776
6774
6777
6775
<li><p> Let <var> totalRequestLength</var> be <var> request</var> 's <a>total request length</a>
6778
6776
6779
- <li><p> If the <a>available deferred fetching quota</a> given <var> request</var> 's
6777
+ <li><p> If the <a>available deferred-fetch quota</a> given <var> request</var> 's
6780
6778
<a for=request>client</a> and <var> request</var> 's <a for=request>URL</a>' s <a for=url>origin</a>
6781
6779
is less than <var> totalRequestLength</var> , then throw a "{{QuotaExceededError}} " {{DOMException}} .
6782
6780
@@ -6876,7 +6874,7 @@ i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after
6876
6874
</ol>
6877
6875
</div>
6878
6876
6879
- <h4 id=deferred-fetching -quota>Deferred fetching quota</h4>
6877
+ <h4 id=deferred-fetch -quota>Deferred fetching quota</h4>
6880
6878
6881
6879
<p class=note> The quota asserts that this deferred fetch doesn't exceed two quotas: one for the
6882
6880
document and it's same-origin same-tree relatives, and one for the reporting origin (64 kibibytes).
@@ -6893,181 +6891,141 @@ This specification defined a <a>policy-controlled feature</a> identified by the
6893
6891
<a for="policy-controlled feature">default allowlist</a> is `*`.
6894
6892
6895
6893
<div algorithm>
6896
- <p> To get the <dfn>available deferred fetching quota</dfn> given a <code> Document</code>
6894
+ <p> To get the <dfn>available deferred-fetch quota</dfn> given a <code> Document</code>
6897
6895
<var> document</var> and an <a for=/>origin</a> -or-null <var> origin</var> :
6898
6896
6899
6897
<ol>
6900
- <li><p> Let <var> relativeNavigables </var> be <var> document</var> 's
6901
- <a>deferred fetch quota-sharing navigables</a> .
6898
+ <li><p> Let <var> navigables </var> be <var> document</var> 's <a>inclusive ancestor navigables</a> ,
6899
+ <a for=list data-lt=extend>extended with</a> <var> document </var> 's <a>descendant navigables</a> .
6902
6900
6903
- <li>
6904
- <p> Let <var> remainingTotalQuota</var> be 640 kibibytes.
6905
- <p class="note allow-2119"> 640kb should be enough for everyone.
6901
+ <li><p> Let <var> quota</var> be zero.
6906
6902
6907
- <li>
6908
- <p> Let <var> topRelativeNavigable</var> in <var> relativeNavigables</var> [0] .
6903
+ <li><p> Let <var> quotaForOrigin</var> be 64 kibibytes.
6909
6904
6910
6905
<li>
6911
- <p> If <var> topRelativeNavigable </var> is a <a for=/>top-level traversable</a> then :
6906
+ <p> For each <var> otherNavigable </var> in <var> navigables </var> :
6912
6907
<ol>
6913
- <li><p> If <var> topRelativeNavigable</var> 's <a>active document</a> is not <a>allowed to use</a>
6914
- the <a>policy-controlled feature</a> {{PermissionPolicy/"deferred-fetch"}} , then return 0.
6915
-
6908
+ <li><p> Let <var> otherDocument</var> be <var> otherNavigable</var> 's <a>active document</a> .
6916
6909
<li>
6917
- <p> Otherwise, if <var> topRelativeNavigable</var> 's <a>active document</a> is
6918
- <a>allowed to use</a> the <a>policy-controlled feature</a>
6919
- {{PermissionPolicy/"deferred-fetch-minimal"}} , then set <var> remainingTotalQuota</var> to 512
6920
- kibibytes.
6921
-
6922
- <p class=note> When this permission policy is enabled, this document delegates 8KB to each of
6923
- the first 16 cross-origin subframes leaving 512kb for its own quota.
6924
- </ol>
6925
-
6926
- <li>
6927
- <p> Otherwise:</p>
6928
- <ol>
6929
- <li><p> Let <var> containerPolicy</var> be <var> topRelativeNavigable</var> 's
6930
- <a for=navigable>container</a> 's <a>deferred fetch policy</a> .
6931
-
6932
- <li><p> If <var> containerPolicy</var> is <code> disabled</code> or
6933
- <var> topRelativeNavigable</var> 's <a>active document</a> is not <a>allowed to use</a>
6934
- <var> containerPolicy</var> , then return 0.
6910
+ <p> If <var> document</var> and <var> otherDocument</var> <a>share deferred-fetch quota</a> ,
6911
+ then:
6912
+ <ol>
6913
+ <li>
6914
+ <p> If <var> otherDocument</var> 's <a>node navigable</a> is a
6915
+ <a for=/>top-level traversable</a> , then:
6916
+ <ol>
6917
+ <li><p> Assert: <var> quota</var> is zero.
6935
6918
6936
- <li><p> Otherwise, set <var> remainingTotalQuota </var> to the
6937
- <a>initial subframe deferred fetch quota </a> given <var> containerPolicy </var> .
6938
- </ol>
6919
+ <li><p> If either <var> document </var> or <var> otherDocument </var> are not
6920
+ <a>allowed to use </a> the <a>policy-controlled feature</a>
6921
+ {{PermissionPolicy/"deferred-fetch"}} , then return 0.
6939
6922
6940
- <li><p> Let <var> remainingQuotaForOrigin</var> be <var> remainingTotalQuota</var> .
6923
+ <li>
6924
+ <p> Otherwise, if <var> otherDocument</var> is
6925
+ <a>allowed to use</a> the <a>policy-controlled feature</a>
6926
+ {{PermissionPolicy/"deferred-fetch-minimal"}} , then set <var> quota</var> to 512
6927
+ kibibytes.
6941
6928
6942
- <li><p> If <var> remainingQuotaForOrigin </var> is greater than 64 kibibytes, then set
6943
- <var> remainingQuotaForOrigin </var> to 64 kibibytes .
6929
+ <p class=note> When this permission policy is enabled, this document delegates 8KB to each of
6930
+ the first 16 cross-origin subframes leaving 512kb for its own quota .
6944
6931
6945
- <li>
6946
- <p> <a for=list>For each</a> <var> navigable </var> in <var> relativeNavigables </var> :
6947
- <ol>
6948
- <li >
6949
- <p> <a for=list>For each</a> <a>deferred fetch record</a> <var> deferredRecord </var> in
6950
- <var> navigable </var> 's <a>active document </a>' s <a for= fetch>fetch group </a> 's
6951
- < a for=" fetch group">deferred fetch records </a>: </p>
6952
-
6953
- <ol>
6954
- <li><p> Let <var> length</var> be the <a>total request length</a> of <var> deferredRecord </var> 's
6955
- <a for="deferred fetch record">request</a> .
6932
+ <li>
6933
+ <p> Otherwise, set <var> quota </var> be 640 kibibytes.
6934
+ <p class="note allow-2119"> 640kb should be enough for everyone.
6935
+ </ol >
6936
+ <li>
6937
+ <p> <a for=list>For each </a> <a>deferred fetch record </a> <var> deferredRecord </var> in
6938
+ <var> otherDocument </var> 's < a for=fetch> fetch group </a>' s
6939
+ <a for="fetch group">deferred fetch records</a> : </p>
6940
+ <ol>
6941
+ <li><p> Let <var> length</var> be the <a>total request length</a> of
6942
+ <var> deferredRecord </var> 's <a for="deferred fetch record">request</a> .
6956
6943
6957
- <li><p> Decrement <var> remainingTotalQuota </var> by <var> length</var> .
6944
+ <li><p> Decrement <var> quota </var> by <var> length</var> .
6958
6945
6959
- <li><p> If <var> origin</var> is not null, and <var> deferredRecord</var> 's
6960
- <a for="deferred fetch record">request</a> 's <a for=request>URL</a>' s <a for=url>origin</a> is
6961
- <a>same origin</a> with <var> origin</var> , then decrement <var> remainingQuotaForOrigin</var> by
6962
- <var> length</var> .
6946
+ <li><p> If <var> origin</var> is not null, and <var> deferredRecord</var> 's
6947
+ <a for="deferred fetch record">request</a> 's <a for=request>URL</a>' s <a for=url>origin</a>
6948
+ is <a>same origin</a> with <var> origin</var> , then decrement <var> quotaForOrigin</var> by
6949
+ <var> length</var> .
6950
+ </ol>
6963
6951
</ol>
6964
6952
6965
- <li><p> <a for=list>For each</a> <var> maybeContainer</var> of <a>shadow-including descendant</a>
6966
- of <var> navigable</var> 's <a for=navigable>active document</a> , if <var> maybeContainer</var> is a
6967
- <a>navigable container</a> and <var> relativeNavigables</var> does not
6968
- <a for=list>contain</a> <var> maybeContainer</var> 's <a>content navigable</a> , then decrement
6969
- <var> remainingTotalQuota</var> by the <a>initial subframe deferred fetch quota</a> given
6970
- <var> maybeContainer</var> 's <a>deferred fetch policy</a> .
6953
+ <li>
6954
+ <p> Otherwise, if <var> navigable</var> is not a <a for=/>top-level traversable</a> , and its
6955
+ <a for=navigable>parent</a> 's <a>active document</a> and <var> document</var>
6956
+ <a>share deferred-fetch quota</a> , then decrement <var> quota</var> by the
6957
+ <a>subframe reserved deferred-fetch quota</a> given <var> navigable</var> 's
6958
+ <a>navigable container</a> 's <a>subframe reserved deferred-fetch quota</a> .
6959
+
6960
+ <p class=note> This is a cross-origin/cross-agent subframe, so it spends some of the quota of
6961
+ this document and its relatives.
6971
6962
</ol>
6963
+ <li><p> If <var> quota</var> is less than zero, than return zero.
6972
6964
6973
- <li><p> If <var> remainingTotalQuota </var> is less than <var> remainingQuotaForOrigin </var> , then
6974
- return <var> remainingTotalQuota </var> .
6965
+ <li><p> If <var> quota </var> is less than <var> quotaForOrigin </var> , then
6966
+ return <var> quota </var> .
6975
6967
6976
- <li><p> Return <var> remainingQuotaForOrigin </var> .
6968
+ <li><p> Return <var> quotaForOrigin </var> .
6977
6969
</ol>
6978
6970
</div>
6979
6971
6980
6972
<div algorithm>
6981
- <p> To <dfn export>determine subframe deferred fetch policy</dfn> for a <a>navigable container</a>
6982
- <var> container</var> and an <a for=/>origin</a> <var> originToNavigateTo</var> :
6983
-
6984
- <p class=note> This is called whenever a <a>navigable container</a> is being navigated, e.g. by
6985
- setting an iframe's <a attribute for=HTMLIFrameElement>src</a> .
6986
-
6987
- <ol>
6988
- <li><p> Set <var> container</var> 's <a>deferred fetch policy</a> to <code> disabled</code> .
6989
-
6990
- <li><p> If the <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6991
- for {{PermissionPolicy/"deferred-fetch"}} , <var> navigable</var> 's <a>navigable container</a> and
6992
- <var> originToNavigateTo</var> is <code> Enabled</code> , and the
6993
- <a>available deferred fetching quota</a> for <var> container</var> 's <a>container document</a> is
6994
- equal or greater than 64 kibibytes, then set <var> container</var> 's
6995
- <a>deferred fetch policy</a> to {{PermissionPolicy/"deferred-fetch"}} and return.
6996
-
6997
- <li><p> If the <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6973
+ <p> To <dfn export>reserve deferred-fetch quota</dfn> for a <a>navigable container</a>
6974
+ <var> container</var> given an <a for=/>origin</a> <var> originToNavigateTo</var> , set
6975
+ <var> container</var> 's <a>reserved deferred-fetch quota</a> to the result of running the steps
6976
+ corresponding to the first matching statement:
6977
+
6978
+ <dl class=switch>
6979
+ <dt> The <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6980
+ for {{PermissionPolicy/"deferred-fetch"}} , <var> container</var> and <var> originToNavigateTo</var>
6981
+ is <code> Enabled</code> , and the <a>available deferred-fetch quota</a> for
6982
+ <var> container</var> 's <a>container document</a> is equal or greater than 64 kibibytes
6983
+ <dd><p> Return 64 kibibytes
6984
+
6985
+ <dt><var> container</var> 's <a>node document</a> and <var>container</var>' s <a>node navigable</a> 's
6986
+ <a for=navigable>top-level traversable</a> 's <a>active document</a
6987
+ <a>share deferred-fetch quota</a> , and the
6988
+ <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6998
6989
for {{PermissionPolicy/"deferred-fetch-minimal"}} , <var> container</var> and
6999
- <var> originToNavigateTo</var> is <code> Disabled</code> , then set <var> container</var> 's
7000
- <a>deferred fetch policy</a> to <code> disabled</code> and return.
7001
-
7002
-
7003
- <li><p> Let <var> topLevelRelatives</var> be <var> container</var> 's <a>container document</a>' s
7004
- <a>deferred fetch quota-sharing navigables</a> .
7005
-
7006
- <li>
7007
- <p> If <var> topLevelRelatives</var> does not <a for=list>contain</a> <var> container</var> 's
7008
- <a>node navigable</a> 's <a for=navigable>top-level traversable</a> , then
7009
- set <var> container</var> 's <a>deferred fetch policy</a> to <code> disabled</code> and
7010
- return.
7011
-
7012
- <p class=note> Only the top level document and related documents can delegate the
7013
- {{PermissionPolicy/"deferred-fetch-minimal"}} policy.
7014
-
7015
- <li><p> Let <var> framesWithMinimalQuotaPolicy</var> be zero.
7016
- <li>
7017
- <p> <a for=list>For each</a> <var> navigable</var> that matches the following conditions:
7018
- <ul class=brief>
6990
+ <var> originToNavigateTo</var> is <code> Enabled</code>
6991
+ <dd>
6992
+ <ol>
6993
+ <li><p> Let <var> navigablesWithMinimalQuota</var> be <var> container</var> 's
6994
+ <a>node navigable</a> 's <a for=navigable>top-level traversable</a>' s
6995
+ <a>inclusive descendant navigables</a> .
7019
6996
7020
- <li><p><var> navigable</var> is not <var> container</var> 's <a>content navigable</a> .
6997
+ <li>
6998
+ <p> <a for=list>Remove</a> from <var> navigablesWithMinimalQuota</var> any <var> navigable</var>
6999
+ who meets any of the following conditions:
7021
7000
7022
- <li><p><var> topLevelRelatives </var> <a for=list>contains</a> <var> navigable </var> 's
7023
- <a for= navigable>parent </a>
7001
+ <ul class=brief>
7002
+ <li><p><var> navigable </var> is <var> container </var> 's <a>content navigable</a>.
7024
7003
7025
- <li><p><var> topLevelRelatives</var> does not <a for=list>contain</a> <var> navigable</var>
7004
+ <li><p><var> navigable</var> 's <a>active document</a> and <var>container</var>' s
7005
+ <a>node navigable</a> 's <a for=navigable>top-level traversable</a>
7006
+ <a>share deferred-fetch quota</a> .
7026
7007
7027
- <li><p><var> navigable</var> 's <a>navigable container</a >' s <a>deferred fetch policy </a> is
7028
- {{PermissionPolicy/"deferred-fetch-minimal"}}
7029
- </ul>
7008
+ <li><p><var> navigable</var> 's <var> container</var >' s <a>reserved deferred- fetch quota </a>
7009
+ is not 8 kibibytes.
7010
+ </ul>
7030
7011
7031
- <p> Increment <var> framesWithMinimalQuotaPolicy</var> by 1.
7012
+ <li><p> If <var> navigablesWithMinimalQuota</var> 's <a for=list>size</a> is greater than 16,
7013
+ then return zero.
7032
7014
7033
- <li><p> If <var> framesWithMinimalQuotaPolicy</var> is less than 16, then set <var> container</var> 's
7034
- <a>deferred fetch policy</a> to {{PermissionPolicy/"deferred-fetch-minimal"}} .
7035
- </ol>
7036
- </div>
7015
+ <li><p> Return 8 kibibytes.
7016
+ </ol>
7017
+ <dt> Otherwise
7018
+ <dd><p> Return zero.
7019
+ </dl>
7037
7020
7038
- <div algorithm>
7039
- The <dfn>initial subframe deferred fetch quota</dfn> is determined by the following table:
7040
- <table>
7041
- <tr>
7042
- <th> Policy
7043
- <th> Quota
7044
- <tr>
7045
- <td> {{PermissionPolicy/"deferred-fetch"}}
7046
- <td> 64 kibibytes
7047
- <tr>
7048
- <td> {{PermissionPolicy/"deferred-fetch-minimal"}}
7049
- <td> 8 kibibytes
7050
- <tr>
7051
- <td><code> disabled</code>
7052
- <td> 0 kibibytes
7053
- </table>
7054
7021
</div>
7055
7022
7056
7023
<div algorithm>
7057
- <p> To get the <dfn>deferred fetch quota-sharing navigables</dfn> of a <code> Document</code>
7058
- <var> document</var> :</p>
7059
- <ol>
7060
- <li><p> Let <var> relatives</var> be <var> document</var> 's <a>node navigable</a>' s
7061
- <a for=navigable>top-level traversable</a> 's <a for=navigable>active document</a>' s
7062
- <a>inclusive descendant navigables</a> .
7063
-
7064
- <li><p> <a for=list>Remove</a> from <var> relatives</var> all navigables whose
7065
- <a>active document</a> 's <a for=Document>origin</a> is not <a>same origin</a> with
7066
- <var> document</var> 's <a for=Document>URL</a>' s <a for=url>origin</a> , and whose
7067
- <a>active document</a> 's <a>relevant agent</a> is not <var>document</var>' s <a>relevant agent</a> .
7068
-
7069
- <li><p> Return <var> relatives</var> .
7070
- </ol>
7024
+ <p> Two <code> Documents</code> <var> a</var> and <var> b</var> are said to
7025
+ <dfn>share deferred-fetch quota</dfn> if <var> a</var> 's
7026
+ <a>relevant agent</a> is <var> b</var> 's <a>relevant agent</a>, and <var>a</var>' s
7027
+ <a for=Document>URL</a> 's <a for=url>origin</a> is <a>same origin</a> with var>b</var>' s
7028
+ <a for=Document>URL</a> 's <a for=url>origin</a> .
7071
7029
</div>
7072
7030
7073
7031
0 commit comments