Skip to content

Commit

Permalink
Rename to fetchLater and backgroundTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
noamr committed May 8, 2023
1 parent 6cf8ac7 commit b38eac5
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ has the following <a for=struct>items</a>:
<dt><dfn export for="deferred fetch record">request</dfn>
<dd>A <a for=/>request</a>

<dt><dfn export for="deferred fetch record">inactive timeout</dfn> (default null)
<dt><dfn export for="deferred fetch record">inactivity deferred delay</dfn> (default null)
<dd>Null or a <a>duration</a>

<dt><dfn export for="deferred fetch record">pending steps</dfn> (default null)
Expand Down Expand Up @@ -2769,12 +2769,13 @@ has the following <a for=struct>items</a>:
<li>
<p><a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> in
<var>fetchGroup</var>'s <a for="fetch group">deferred fetch records</a> whose
<a for="deferred fetch record">inactive timeout</a> is not null: set <var>deferredRecord</var>'s
<a for="deferred fetch record">pending steps</a> to running the following steps <a>in parallel</a>:
<a for="deferred fetch record">inactivity deferred delay</a> is not null: set
<var>deferredRecord</var>'s <a for="deferred fetch record">pending steps</a> to running the
following steps <a>in parallel</a>:

<ol>
<li><p>Wait until <var>deferredRecord</var>'s
<a for="deferred fetch record">inactive timeout</a> have passed.
<a for="deferred fetch record">inactivity deferred delay</a> have passed.

<li>
<p><a>Queue a fetch task</a> to run the following steps with
Expand Down Expand Up @@ -6714,7 +6715,7 @@ when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after a tim
<div algorithm="request-a-deferred-fetch">
<p>To <dfn>request a deferred fetch</dfn> given a
<a for=/>request</a> <var>request</var> and a null-or-{{DOMHighResTimeStamp}}
<var>inactiveTimeout</var> (default null):
<var>inactivityDeferredDelay</var> (default null):

<ol>
<li><p>Assert: <var>request</var>'s <a for=request>client</a> is an
Expand Down Expand Up @@ -6750,8 +6751,8 @@ when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after a tim
<li><p>Let <var>deferredRecord</var> be a new <a>deferred fetch record</a> whose
<a for="deferred fetch record">request</a> is <var>request</var>.

<li><p>Set <var>deferredRecord</var>'s <a for="deferred fetch record">inactive timeout</a> to
<var>inactiveTimeout</var>.
<li><p>Set <var>deferredRecord</var>'s <a for="deferred fetch record">inactivity deferred delay</a>
to <var>inactivityDeferredDelay</var>.

<li><p><a for=list>Append</a> <var>deferredRecord</var> to <var>request</var>'s
<a for=request>client</a>'s <a for=fetch>fetch group</a>'s
Expand Down Expand Up @@ -8595,22 +8596,22 @@ with a <var>promise</var>, <var>request</var>, <var>responseObject</var>, and an
</div>


<h3 id=request-deferred-fetch-method>RequestDeferredFetch method</h3>
<h3 id=fetch-later-method>FetchLater method</h3>

<pre class=idl>

dictionary DeferredRequestInit : RequestInit {
DOMHighResTimeStamp inactiveTimeout;
DOMHighResTimeStamp backgroundTimeout;
};

partial interface mixin WindowOrWorkerGlobalScope {
[NewObject] Promise&lt;Response> requestDeferredFetch(RequestInfo input, optional DeferredRequestInit init = {});
[NewObject] Promise&lt;Response> fetchLater(RequestInfo input, optional DeferredRequestInit init = {});
};
</pre>

<div algorithm="dom-requestdeferredfetch">
<div algorithm="dom-fetch-later">
<p>The
<dfn id=dom-global-requestdeferredfetch method for=WindowOrWorkerGlobalScope><code>requestDeferredFetch(<var>input</var>, <var>init</var>)</code></dfn>
<dfn id=dom-global-fetch-later method for=WindowOrWorkerGlobalScope><code>fetchLater(<var>input</var>, <var>init</var>)</code></dfn>
method steps are:

<ol>
Expand All @@ -8626,16 +8627,16 @@ method steps are:

<li><p>Let <var>request</var> be <var>requestObject</var>'s <a for=Request>request</a>.

<li><p>Let <var>inactiveTimeout</var> be null.
<li><p>Let <var>backgroundTimeout</var> be null.

<li><p>If <var>init</var> is given and <var>init</var>["<code>inactiveTimeout</code>"]
<a for=map>exists</a> then set <var>inactiveTimeout</var> to
<var>init</var>["<code>inactiveTimeout</code>"].
<li><p>If <var>init</var> is given and <var>init</var>["<code>backgroundTimeout</code>"]
<a for=map>exists</a> then set <var>backgroundTimeout</var> to
<var>init</var>["<code>backgroundTimeout</code>"].

<li><p>If <var>inactiveTimeout</var> is not a {{DOMHighResTimeStamp}} then throw a {{TypeError}}.
<li><p>If <var>backgroundTimeout</var> is not a {{DOMHighResTimeStamp}} then throw a {{TypeError}}.

<li><p>Let <var>deferredRecord</var> be the result of calling
<a>request a deferred fetch</a> given <var>request</var> and <var>inactiveTimeout</var>. If that
<a>request a deferred fetch</a> given <var>request</var> and <var>backgroundTimeout</var>. If that
threw an exception, <a for=/>reject</a> <var>promise</var> with that exception and return
<var>promise</var>.

Expand Down

0 comments on commit b38eac5

Please sign in to comment.