Skip to content

Commit 92f0b82

Browse files
committed
Make tree accessible
1 parent eb52783 commit 92f0b82

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

fetch.bs

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6922,59 +6922,66 @@ calls would succeed and the last one would throw.
69226922
// In same-origin nested document
69236923
fetchLater("https://b.example.com", {method: "POST", body: a_64kb_body});
69246924

6925-
// In cross-origin nested document at https://frame.example.com
6925+
// In cross-origin nested document at https://fratop.example.com
69266926
fetchLater("https://a.example.com", {body: a_5kb_body});
69276927
fetchLater("https://a.example.com", {body: a_12kb_body});
69286928
</code></pre>
69296929

69306930

69316931
<p>To make the previous example not throw, the top-level document can delegate some of its quota
6932-
to <code>https://frame.example.com</code>, for example by serving the following header:
6933-
<pre><code class=lang-http>Permissions-Policy: deferred-fetch=(self "https://frame.example.com")</code></pre>
6932+
to <code>https://fratop.example.com</code>, for example by serving the following header:
6933+
<pre><code class=lang-http>Permissions-Policy: deferred-fetch=(self "https://fratop.example.com")</code></pre>
69346934

69356935
<p>Each nested document reserves its own quota. So the following would work, because each frame
69366936
reserve 8 kibibytes:
69376937
<pre><code class=lang-javascript>
6938-
// In cross-origin nested document at https://frame.example.com/frame-1
6938+
// In cross-origin nested document at https://fratop.example.com/frame-1
69396939
fetchLater("https://a.example.com", {body: a_6kb_body});
69406940

6941-
// In cross-origin nested document at https://frame.example.com/frame-2
6941+
// In cross-origin nested document at https://fratop.example.com/frame-2
69426942
fetchLater("https://a.example.com", {body: a_6kb_body});
69436943
</code></pre>
69446944

6945-
<p>The following chart illustrates how quota is distributed to different nested documents in a tree:
6946-
6947-
<pre><code>
6948-
+ https://me.example.com with Permissions-policy: deferred-fetch=(self "https://ok.example.com")
6949-
| (See below for quota)
6950-
|
6951-
+ ---- + https://me.example.com
6952-
| | Shares quota with the <a for=/>top-level traversable</a>, as they're same origin.
6953-
| |
6954-
| + ---- + https://x.example.com
6955-
| 8 kibibytes.
6956-
|
6957-
|
6958-
+ ---- + https://x.example.com
6959-
| 8 kibibytes.
6960-
| |
6961-
| + https://me.example.com
6962-
| 0. Even though it's same origin with the <a for=/>top-level traversable</a>, it does not
6963-
| automatically share its quota as they are separated by a cross-origin intermediary.
6964-
|
6965-
+ ---- + https://ok.example.com/good
6966-
| | 64 kibibytes, granted via the "{{PermissionsPolicy/deferred-fetch}}" policy.
6967-
| |
6968-
| + ---- + https://x.example.com
6969-
| 0. Only documents with the same origin as the <a for=/>top-level traversable</a> can
6970-
| grant the 8 kibibytes based on the "{{PermissionsPolicy/deferred-fetch-minimal}}" policy.
6971-
|
6972-
+ ---- + https://ok.example.com/redirect, navigated to https://x.example.com
6973-
| 0. The reserved 64 kibibytes for https://ok.example.com are not available for https://x.example.com.
6974-
|
6975-
+ ---- + https://ok.example.com/back, navigated to https://me.example.com
6976-
Shares quota with the <a for=/>top-level traversable</a>, as they're same origin.
6977-
</code></pre>
6945+
<p>The following tree illustrates how quota is distributed to different nested documents in a tree:
6946+
6947+
<ul>
6948+
<li>
6949+
<p><code>https://top.example.com</code>, with permissions policy set to
6950+
<code>Permissions-policy: deferred-fetch=(self "https://ok.example.com")</code></p>
6951+
<ul>
6952+
<li>
6953+
<p><code>https://top.example.com/frame</code>: shares quota with the top-level traversable, as
6954+
they are same origin.</p>
6955+
6956+
<ul><li><p><code>https://x.example.com</code>: receives 8 kibibytes.</p></li></ul>
6957+
</li>
6958+
6959+
<li>
6960+
<p><code>https://x.example.com</code>: receives 8 kibibytes.</p>
6961+
<ul><li><p><code>https://top.example.com</code>: 0. Even though it's same origin with the
6962+
top-level traversable, it does not automatically share its quota as they are separated by a
6963+
cross-origin intermediary.</p></ul>
6964+
</li>
6965+
6966+
<li>
6967+
<p><code>https://ok.example.com/good</code>: receives 64 kibibytes, granted via the
6968+
"{{PermissionsPolicy/deferred-fetch}}" policy.</p>
6969+
6970+
<ul><li><p><code>https://x.example.com</code>: receives no quota. Only documents with the same
6971+
origin as the top-level traversable can grant the 8 kibibytes based on the
6972+
"{{PermissionsPolicy/deferred-fetch-minimal}}" policy.</p></li></ul>
6973+
6974+
<li><p><code>https://ok.example.com/redirect</code>, navigated to
6975+
<code>https://x.example.com</code>: receives no quota. The reserved 64 kibibytes for
6976+
<code>https://ok.example.com</code> are not available for
6977+
<code>https://x.example.com</code>.</p></li>
6978+
6979+
<li><p><code>https://ok.example.com/back</code>, navigated to
6980+
<code>https://top.example.com</code>: shares quota with the top-level traversable, as they're
6981+
same origin.</p></li>
6982+
</ul>
6983+
</li>
6984+
</ul>
69786985

69796986
<p>In the above example, the <a for=/>top-level traversable</a> and its <a>same origin</a>
69806987
descendants share a quota of 384 kibibytes. That value is computed as such:

0 commit comments

Comments
 (0)