@@ -6882,30 +6882,42 @@ The larger quota ensures that the top-level {{Document}} and its subresources do
6882
6882
an unlimited amount of bandwidth after being destroyed. The per-origin quota ensures that a single
6883
6883
reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
6884
6884
6885
- This specification defined a <a>policy-controlled feature</a> identified by the string
6885
+ <p> This specification defined a <a>policy-controlled feature</a> identified by the string
6886
6886
<dfn for=PermissionPolicy enum-value>"deferred-fetch"</dfn> . Its
6887
6887
<a for="policy-controlled feature">default allowlist</a> is `'self' `.
6888
6888
6889
- This specification defined a <a>policy-controlled feature</a> identified by the string
6889
+ <p> This specification defined a <a>policy-controlled feature</a> identified by the string
6890
6890
<dfn for=PermissionPolicy enum-value>"deferred-fetch-minimal"</dfn> . Its
6891
6891
<a for="policy-controlled feature">default allowlist</a> is `*`.
6892
6892
6893
+ <p> The <dfn>top-level deferred-fetch quota</dfn> is 640 kibibytes.
6894
+ <p> The <dfn>optional subframe deferred-fetch quota</dfn> is 64 kibibytes.
6895
+ <p> The <dfn>minimal subframe deferred-fetch quota</dfn> is 8 kibibytes.
6896
+ <p> The <dfn>deferred-fetch delegated quota</dfn> is 128 kibibytes.
6897
+
6893
6898
<div algorithm>
6894
6899
<p> To get the <dfn>available deferred-fetch quota</dfn> given a <code> Document</code>
6895
6900
<var> document</var> and an <a for=/>origin</a> -or-null <var> origin</var> :
6896
6901
6897
6902
<ol>
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> .
6900
-
6901
6903
<li><p> Let <var> quota</var> be zero.
6902
6904
6903
- <li><p> Let <var> quotaForOrigin</var> be 64 kibibytes.
6905
+ <li>
6906
+ <p> Let <var> quotaForOrigin</var> be 64 kibibytes.
6907
+ <p class=note>
6904
6908
6905
6909
<li>
6906
- <p> For each <var> otherNavigable</var> in <var> navigables</var> :
6910
+ <p> For each <var> otherNavigable</var> in <var> document</var> 's <a>node navigable</a>' s
6911
+ <a for=navigable>top-level traversable</a> 's <a>inclusive descendant navigables</a> :
6912
+
6913
+ <p class=note> This algorithm iterates over the entire navigable tree. It accumulates quota from
6914
+ the <a for=/>top-level traversable</a> , and from subframes who inherit quota from cross-origin or
6915
+ cross-agent navigables. Subsequently, it subtracts the quota delegated to cross-origin or
6916
+ cross-agent subframes, as well as quota spent on pending deferred fetch requests.
6917
+
6907
6918
<ol>
6908
6919
<li><p> Let <var> otherDocument</var> be <var> otherNavigable</var> 's <a>active document</a> .
6920
+
6909
6921
<li>
6910
6922
<p> If <var> document</var> and <var> otherDocument</var> <a>share deferred-fetch quota</a> ,
6911
6923
then:
@@ -6916,23 +6928,44 @@ This specification defined a <a>policy-controlled feature</a> identified by the
6916
6928
<ol>
6917
6929
<li><p> Assert: <var> quota</var> is zero.
6918
6930
6919
- <li><p> If either <var> document </var> or <var> otherDocument</var> are not
6931
+ <li><p> If <var> otherDocument</var> is not
6920
6932
<a>allowed to use</a> the <a>policy-controlled feature</a>
6921
6933
{{PermissionPolicy/"deferred-fetch"}} , then return 0.
6922
6934
6923
6935
<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.
6936
+ <p> Set <var> quota</var> be 640 kibibytes.
6937
+ <p class="note allow-2119"> 640kb should be enough for everyone.
6928
6938
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.
6939
+ <li><p> If <var> otherDocument</var> is <a>allowed to use</a> the
6940
+ <a>policy-controlled feature</a> {{PermissionPolicy/"deferred-fetch-minimal"}} , then
6941
+ decrement <var> quota</var> by <a>deferred-fetch delegated quota</a> .
6942
+ </ol>
6943
+
6944
+ <li>
6945
+ <ol>
6946
+ <li><p> Let <var> otherContainer</var> be <var> otherDocument</var> 's <a>node navigable</a>' s
6947
+ <a>navigable container</a> .
6931
6948
6932
6949
<li>
6933
- <p> Otherwise, set <var> quota</var> be 640 kibibytes.
6934
- <p class="note allow-2119"> 640kb should be enough for everyone.
6950
+ <p> If <var> otherContainer</var> 's <a>node document</a> and <var> otherDocument</var> do
6951
+ not <a>share deferred-fetching quota</a> , then:
6952
+
6953
+ <ol>
6954
+ <li><p> If <var> otherContainer</var> 's <a>subframe reserved deferred-fetch quota</a> is
6955
+ <a>optional subframe deferred-fetch quota</a> , and <var> otherDocument</var> is
6956
+ <a>allowed to use</a> the <a>policy-controlled feature</a>
6957
+ {{PermissionPolicy/"deferred-fetch"}} , then increment <var> quota</var> by
6958
+ <a>optional subframe deferred-fetch quota</a> .
6959
+
6960
+ <li><p> Otherwise, if <var> otherContainer</var> 's
6961
+ <a>subframe reserved deferred-fetch quota</a> is
6962
+ <a>minimal subframe deferred-fetch quota</a> and <var> otherDocument</var>
6963
+ is <a>allowed to use</a> the <a>policy-controlled feature</a>
6964
+ {{PermissionPolicy/"deferred-fetch-minimal"}} , then increment <var> quota</var> by
6965
+ <a>minimal subframe deferred-fetch quota</a> .
6966
+ </ol>
6935
6967
</ol>
6968
+
6936
6969
<li>
6937
6970
<p> <a for=list>For each</a> <a>deferred fetch record</a> <var> deferredRecord</var> in
6938
6971
<var> otherDocument</var> 's <a for=fetch>fetch group</a>' s
@@ -6951,11 +6984,11 @@ This specification defined a <a>policy-controlled feature</a> identified by the
6951
6984
</ol>
6952
6985
6953
6986
<li>
6954
- <p> Otherwise, if <var> navigable </var> is not a <a for=/>top-level traversable</a> , and its
6987
+ <p> Otherwise, if <var> otherNavigable </var> is not a <a for=/>top-level traversable</a> , and its
6955
6988
<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> .
6989
+ <a>share deferred-fetch quota</a> , then decrement <var> quota</var> by
6990
+ <var> otherNavigable </var> 's <a >navigable container</a >' s
6991
+ <a>subframe reserved deferred-fetch quota</a> .
6959
6992
6960
6993
<p class=note> This is a cross-origin/cross-agent subframe, so it spends some of the quota of
6961
6994
this document and its relatives.
@@ -6979,8 +7012,9 @@ corresponding to the first matching statement:
6979
7012
<dt> The <a data-lt="define an inherited policy for feature in container">inherited policy</a>
6980
7013
for {{PermissionPolicy/"deferred-fetch"}} , <var> container</var> and <var> originToNavigateTo</var>
6981
7014
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
7015
+ <var> container</var> 's <a>container document</a> is equal or greater than
7016
+ <a>optional subframe deferred-fetch quota</a>
7017
+ <dd><p> Return <a>optional subframe deferred-fetch quota</a> .
6984
7018
6985
7019
<dt><var> container</var> 's <a>node document</a> and <var>container</var>' s <a>node navigable</a> 's
6986
7020
<a for=navigable>top-level traversable</a> 's <a>active document</a
@@ -6990,30 +7024,31 @@ corresponding to the first matching statement:
6990
7024
<var> originToNavigateTo</var> is <code> Enabled</code>
6991
7025
<dd>
6992
7026
<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> .
7027
+ <li><p> Let <var> delegatedQuota</var> be <a>deferred-fetch delegated quota</a> .
6996
7028
6997
7029
<li>
6998
- <p> <a for=list>Remove </a> from <var> navigablesWithMinimalQuota </var> any <var> navigable </var>
6999
- who meets any of the following conditions:
7000
-
7030
+ <p> <a for=list>For each </a> <var> navigable </var> in <var> container </var> 's
7031
+ <a>node navigable</a> 's <a for=navigable>top-level traversable</a>' s
7032
+ <a>inclusive descendant navigables</a> who meets all of the following conditions:
7001
7033
<ul class=brief>
7002
- <li><p><var> navigable</var> is <var> container</var> 's <a>content navigable</a> .
7034
+ <li><p><var> navigable</var> is not <var> container</var> 's <a>content navigable</a> .
7003
7035
7004
7036
<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>
7037
+ <a>node navigable</a> 's <a for=navigable>top-level traversable</a> do not
7006
7038
<a>share deferred-fetch quota</a> .
7007
7039
7008
7040
<li><p><var> navigable</var> 's <var>container</var>' s <a>reserved deferred-fetch quota</a>
7009
- is not 8 kibibytes .
7010
- </ul>
7041
+ is <aminimal subframe deferred-fetch quota</a> .
7042
+ </ul> ,
7011
7043
7012
- <li><p> If <var> navigablesWithMinimalQuota</var> 's <a for=list>size</a> is greater than 16,
7044
+ <p> Decrement <var> delegatedQuota</var> by <a>minimal subframe deferred-fetch quota</a> .
7045
+
7046
+ <li><p> If <var> delegatedQuota</var> is less than <a>minimal subframe deferred-fetch quota</a> ,
7013
7047
then return zero.
7014
7048
7015
- <li><p> Return 8 kibibytes .
7049
+ <li><p> Return <a>minimal subframe deferred-fetch quota</a> .
7016
7050
</ol>
7051
+
7017
7052
<dt> Otherwise
7018
7053
<dd><p> Return zero.
7019
7054
</dl>
0 commit comments