Skip to content

Commit 91e2736

Browse files
committed
Refactor quota algorithm
1 parent a984713 commit 91e2736

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

fetch.bs

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6815,33 +6815,18 @@ i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after
68156815
<p>To compute the <dfn>total request length</dfn> of a <a for=/>request</a> <var>request</var>:
68166816

68176817
<ol>
6818-
<li><p>Let <var>totalRequestLength</var> be the [=string/length=] of <var>request</var>'s
6818+
<li><p>Let <var>totalRequestLength</var> be the <a for=string>length</a> of <var>request</var>'s
68196819
<a for=request>URL</a>, <a lt="URL serializer">serialized</a> with
68206820
[=URL serializer/exclude fragment=] set to true.
68216821

6822-
<li><p><a for=list>For each</a> (<var>name</var>, <var>value</var>) in
6822+
<li><p><a for=list>For each</a> (<var>name</var>, <var>value</var>) in <var>request</var>'s
68236823
<a for=request>header list</a>, increment <var>totalRequestLength</var> by <var>name</var>'s
6824-
[=byte sequence/length=] + <var>value</var>'s [=byte sequence/length=].
6824+
<a for="byte sequence">length</a> + <var>value</var>'s <a for="byte sequence">length</a>.
68256825

6826-
<li>
6827-
<p>If <var>request</var>'s <a for=request>body</a> is non-null then:
6828-
6829-
<ol>
6830-
<li><p>If <var>request</var>'s
6831-
<a for=request>body</a>'s <a for=body>length</a> is null, then throw a {{TypeError}}.
6832-
6833-
<li>
6834-
<p>If <var>request</var>'s <a for=request>body</a>'s <a for=body>source</a> is null, then throw a
6835-
{{TypeError}}.
6826+
<li><p>Increment <var>totalRequestLength</var> by <var>request</var>'s
6827+
<a for=request>body</a>'s <a for=body>length</a>.
68366828

6837-
<p class=note>This disallows sending deferred fetches with a live {{ReadableStream}}.
6838-
6839-
<li><p>Increment <var>totalRequestLength</var> by <var>request</var>'s
6840-
<a for=request>body</a>'s <a for=body>length</a>.
6841-
</ol>
6842-
6843-
<li><p>Return <var>totalRequestLength</var>.
6844-
</ol>
6829+
<li><p>Return <var>totalRequestLength</var>.
68456830
</div>
68466831

68476832
<div algorithm>
@@ -6890,7 +6875,6 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
68906875
<dfn for=PermissionPolicy enum-value>"deferred-fetch-minimal"</dfn>. Its
68916876
<a for="policy-controlled feature">default allowlist</a> is `*`.
68926877

6893-
<p>The <dfn>top-level deferred-fetch quota</dfn> is 640 kibibytes.
68946878
<p>The <dfn>optional subframe deferred-fetch quota</dfn> is 64 kibibytes.
68956879
<p>The <dfn>minimal subframe deferred-fetch quota</dfn> is 8 kibibytes.
68966880
<p>The <dfn>deferred-fetch delegated quota</dfn> is 128 kibibytes.
@@ -6948,7 +6932,7 @@ reporting sink (e.g. RUM library) doesn't reserve the whole quota to itself.
69486932

69496933
<li>
69506934
<p>If <var>otherContainer</var>'s <a>node document</a> and <var>otherDocument</var> do
6951-
not <a>share deferred-fetching quota</a>, then:
6935+
not <a>share deferred-fetch quota</a>, then:
69526936

69536937
<ol>
69546938
<li><p>If <var>otherContainer</var>'s <a>subframe reserved deferred-fetch quota</a> is
@@ -7017,7 +7001,7 @@ corresponding to the first matching statement:
70177001
<dd><p>Return <a>optional subframe deferred-fetch quota</a>.
70187002

70197003
<dt><var>container</var>'s <a>node document</a> and <var>container</var>'s <a>node navigable</a>'s
7020-
<a for=navigable>top-level traversable</a>'s <a>active document</a
7004+
<a for=navigable>top-level traversable</a>'s <a>active document</a>
70217005
<a>share deferred-fetch quota</a>, and the
70227006
<a data-lt="define an inherited policy for feature in container">inherited policy</a>
70237007
for {{PermissionPolicy/"deferred-fetch-minimal"}}, <var>container</var> and
@@ -7038,7 +7022,7 @@ corresponding to the first matching statement:
70387022
<a>share deferred-fetch quota</a>.
70397023

70407024
<li><p><var>navigable</var>'s <var>container</var>'s <a>reserved deferred-fetch quota</a>
7041-
is <aminimal subframe deferred-fetch quota</a>.
7025+
is <a>minimal subframe deferred-fetch quota</a>.
70427026
</ul>,
70437027

70447028
<p>Decrement <var>delegatedQuota</var> by <a>minimal subframe deferred-fetch quota</a>.

0 commit comments

Comments
 (0)