Skip to content

Commit cc8b7e5

Browse files
committed
initial nits
1 parent 61f1303 commit cc8b7e5

File tree

1 file changed

+48
-45
lines changed

1 file changed

+48
-45
lines changed

fetch.bs

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,14 +2752,15 @@ functionality.
27522752
<dfn export id=concept-fetch-group for=fetch>fetch group</dfn>.
27532753

27542754
<p>A <a for=fetch>fetch group</a> has an associated
2755-
<dfn lt="fetch record" export for="fetch group" id=concept-fetch-record>fetch records</dfn>,
2756-
a <a for=/>list</a> of <a for="/" data-lt="fetch record">fetch records</a>.
2755+
<dfn lt="fetch record" export for="fetch group" id=concept-fetch-record>fetch records</dfn>, a
2756+
<a for=/>list</a> of <a for="/" data-lt="fetch record">fetch records</a>.
27572757

27582758
<p>A <a for=fetch>fetch group</a> has an associated
2759-
<dfn export for="fetch group" id=concept-defer=fetch-record>deferred fetch records</dfn>,
2760-
a <a for=/>list</a> of <a data-lt="deferred fetch record">deferred fetch records</a>.
2759+
<dfn export for="fetch group" id=concept-defer=fetch-record>deferred fetch records</dfn>, a
2760+
<a for=/>list</a> of <a data-lt="deferred fetch record">deferred fetch records</a>.
27612761

2762-
<p>A <dfn export>fetch record</dfn> is a [=struct=]. It has the following items:
2762+
<p>A <dfn export>fetch record</dfn> is a <a for=/>struct</a> with the following
2763+
<a for=struct>items</a>:
27632764

27642765
<dl>
27652766
<dt><dfn export for="fetch record">request</dfn>
@@ -2770,9 +2771,9 @@ a <a for=/>list</a> of <a data-lt="deferred fetch record">deferred fetch records
27702771
</dl>
27712772
<hr>
27722773

2773-
<p>A <dfn>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed
2774-
to invoke a fetch at a later time, e.g., when a document is unloaded or becomes
2775-
not <a for=Document>fully active</a>. It has the following <a for=struct>items</a>:
2774+
<p>A <dfn>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed to
2775+
invoke a fetch at a later time, e.g., when a document is unloaded or becomes not
2776+
<a for=Document>fully active</a>. It has the following <a for=struct>items</a>:
27762777

27772778
<dl>
27782779
<dt><dfn for="deferred fetch record">request</dfn>
@@ -6995,40 +6996,37 @@ reserve 8 kibibytes:
69956996
<ul>
69966997
<li>
69976998
<p><code>https://top.example.com</code>, with permissions policy set to
6998-
<code>Permissions-policy: deferred-fetch=(self "https://ok.example.com")</code></p>
6999+
<code>Permissions-policy: deferred-fetch=(self "https://ok.example.com")</code>
69997000
<ul>
70007001
<li>
70017002
<p><code>https://top.example.com/frame</code>: shares quota with the top-level traversable, as
7002-
they are same origin.</p>
7003+
they are same origin.
70037004

7004-
<ul><li><p><code>https://x.example.com</code>: receives 8 kibibytes.</p></li></ul>
7005-
</li>
7005+
<ul><li><p><code>https://x.example.com</code>: receives 8 kibibytes.</ul>
70067006

70077007
<li>
7008-
<p><code>https://x.example.com</code>: receives 8 kibibytes.</p>
7008+
<p><code>https://x.example.com</code>: receives 8 kibibytes.
70097009
<ul><li><p><code>https://top.example.com</code>: 0. Even though it's same origin with the
70107010
top-level traversable, it does not automatically share its quota as they are separated by a
7011-
cross-origin intermediary.</p></ul>
7012-
</li>
7011+
cross-origin intermediary.</ul>
70137012

70147013
<li>
70157014
<p><code>https://ok.example.com/good</code>: receives 64 kibibytes, granted via the
7016-
"{{PermissionsPolicy/deferred-fetch}}" policy.</p>
7015+
"{{PermissionsPolicy/deferred-fetch}}" policy.
70177016

70187017
<ul><li><p><code>https://x.example.com</code>: receives no quota. Only documents with the same
70197018
origin as the top-level traversable can grant the 8 kibibytes based on the
7020-
"{{PermissionsPolicy/deferred-fetch-minimal}}" policy.</p></li></ul>
7019+
"{{PermissionsPolicy/deferred-fetch-minimal}}" policy.</ul>
70217020

70227021
<li><p><code>https://ok.example.com/redirect</code>, navigated to
70237022
<code>https://x.example.com</code>: receives no quota. The reserved 64 kibibytes for
70247023
<code>https://ok.example.com</code> are not available for
7025-
<code>https://x.example.com</code>.</p></li>
7024+
<code>https://x.example.com</code>.
70267025

70277026
<li><p><code>https://ok.example.com/back</code>, navigated to
70287027
<code>https://top.example.com</code>: shares quota with the top-level traversable, as they're
7029-
same origin.</p></li>
7028+
same origin.
70307029
</ul>
7031-
</li>
70327030
</ul>
70337031

70347032
<p>In the above example, the <a for=/>top-level traversable</a> and its <a>same origin</a>
@@ -7132,7 +7130,7 @@ descendants share a quota of 384 kibibytes. That value is computed as such:
71327130
<li>
71337131
<p><a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> of
71347132
<var>navigable</var>'s <a for=navigable>active document</a>'s <a>fetch group</a>'s
7135-
<a for="fetch group">deferred fetch records</a>:</p>
7133+
<a for="fetch group">deferred fetch records</a>:
71367134

71377135
<ol>
71387136
<li><p>Let <var>requestLength</var> be the <a>total request length</a> of
@@ -8960,7 +8958,6 @@ partial interface mixin WindowOrWorkerGlobalScope {
89608958
[NewObject] Promise&lt;Response> fetch(RequestInfo input, optional RequestInit init = {});
89618959
};
89628960

8963-
89648961
dictionary DeferredRequestInit : RequestInit {
89658962
DOMHighResTimeStamp activateAfter;
89668963
};
@@ -9114,9 +9111,8 @@ which is an algorithm returning a boolean.
91149111
the result of running <a>this</a>'s <a for=FetchLaterResult>activated getter steps</a>.
91159112
</div>
91169113

9117-
<div algorithm="dom-fetch-later">
9118-
<p>The
9119-
<dfn method for=Window><code>fetchLater(<var>input</var>, <var>init</var>)</code></dfn>
9114+
<div algorithm>
9115+
<p>The <dfn method for=Window><code>fetchLater(<var>input</var>, <var>init</var>)</code></dfn>
91209116
method steps are:
91219117

91229118
<ol>
@@ -9169,11 +9165,17 @@ method steps are:
91699165
<li><p>Return a new {{FetchLaterResult}} whose
91709166
<a for=FetchLaterResult>activated getter steps</a> are to return <var>activated</var>.
91719167
</ol>
9168+
</div>
91729169

91739170
<div class=example id=fetch-later-examples>
91749171
<p>The following call would queue a request to be fetched when the document is terminated:
9175-
<pre><code class=lang-javascript>fetchLater("https://report.example.com", { method: "POST",
9176-
body: JSON.stringify(myReport) })</code></pre>
9172+
9173+
<pre><code class=lang-javascript>
9174+
fetchLater("https://report.example.com", {
9175+
method: "POST",
9176+
body: JSON.stringify(myReport),
9177+
headers: { "Content-Type": "application/json" }
9178+
})</code></pre>
91779179

91789180
<p>The following call would also queue this request after 5 seconds, and the returned value would
91799181
allow callers to observe if it was indeed activated. Note that the request is guaranteed to be
@@ -9183,15 +9185,16 @@ method steps are:
91839185
const result = fetchLater("https://report.example.com", {
91849186
method: "POST",
91859187
body: JSON.stringify(myReport),
9188+
headers: { "Content-Type": "application/json" },
91869189
activateAfter: 5000
91879190
});
91889191

91899192
function check_if_fetched() {
91909193
return result.activated;
9191-
}
9192-
</code></pre>
9194+
}</code></pre>
9195+
9196+
<p>The {{FetchLaterResult}} object can be used together with an {{AbortSignal}}. For example:
91939197

9194-
<p>The {{FetchLaterResult}} object can be used together with an {{AbortSignal}}. For example:
91959198
<pre><code class=lang-javascript>
91969199
let accumulated_events = [];
91979200
let previous_result = null;
@@ -9211,31 +9214,31 @@ method steps are:
92119214
result = fetchLater("https://report.example.com", {
92129215
method: "POST",
92139216
body: JSON.stringify(accumulated_events),
9217+
headers: { "Content-Type": "application/json" },
92149218
activateAfter: 5000,
92159219
abort_signal
92169220
});
9217-
}
9218-
</code></pre>
9221+
}</code></pre>
92199222

9223+
<p>Any of the following calls to <a method><code>fetchLater()</code></a> would throw:
92209224

9221-
<p>Any of the following calls to <a method><code>fetchLater()</code></a> would throw:
9222-
<pre><code class=lang-javascript>
9223-
// Only <a>potentially trustworthy url</a>s are supported.
9224-
fetchLater("http://untrusted.example.com");
9225+
<pre><code class=lang-javascript>
9226+
// Only <a>potentially trustworthy URL</a>s are supported.
9227+
fetchLater("http://untrusted.example.com");
92259228

9226-
// The length of the deferred request has to be known when.
9227-
fetchLater("https://origin.example.com", {body: someDynamicStream});
9229+
// The length of the deferred request has to be known when.
9230+
fetchLater("https://origin.example.com", {body: someDynamicStream});
92289231

9229-
// Deferred fetching only works on active windows.
9230-
const detachedWindow = iframe.contentWindow;
9231-
iframe.remove();
9232-
detachedWindow.fetchLater("https://origin.example.com");
9233-
</code></pre>
9232+
// Deferred fetching only works on active windows.
9233+
const detachedWindow = iframe.contentWindow;
9234+
iframe.remove();
9235+
detachedWindow.fetchLater("https://origin.example.com");</code></pre>
92349236

9235-
See <a href="#deferred-fetch-quota-examples">deferred fetch quota examples</a> for examples
9236-
portraying how the deferred-fetch quota works.
9237+
<p>See <a href="#deferred-fetch-quota-examples">deferred fetch quota examples</a> for examples
9238+
portraying how the deferred-fetch quota works.
92379239
</div>
92389240

9241+
92399242
<h3 id=garbage-collection>Garbage collection</h3>
92409243

92419244
<p>The user agent may <a for="fetch controller">terminate</a> an ongoing fetch if that termination

0 commit comments

Comments
 (0)