From b38eac528624cff4790d8afb54f5d356cf4e15e5 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 8 May 2023 14:06:13 +0300 Subject: [PATCH] Rename to fetchLater and backgroundTimeout --- fetch.bs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/fetch.bs b/fetch.bs index 5e81b407f..b72a36c40 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2701,7 +2701,7 @@ has the following items:
request
A request -
inactive timeout (default null) +
inactivity deferred delay (default null)
Null or a duration
pending steps (default null) @@ -2769,12 +2769,13 @@ has the following items:
  • For each deferred fetch record deferredRecord in fetchGroup's deferred fetch records whose - inactive timeout is not null: set deferredRecord's - pending steps to running the following steps in parallel: + inactivity deferred delay is not null: set + deferredRecord's pending steps to running the + following steps in parallel:

    1. Wait until deferredRecord's - inactive timeout have passed. + inactivity deferred delay have passed.

    2. Queue a fetch task to run the following steps with @@ -6714,7 +6715,7 @@ when a fetch group is terminated, or after a tim

      To request a deferred fetch given a request request and a null-or-{{DOMHighResTimeStamp}} -inactiveTimeout (default null): +inactivityDeferredDelay (default null):

      1. Assert: request's client is an @@ -6750,8 +6751,8 @@ when a fetch group is terminated, or after a tim

      2. Let deferredRecord be a new deferred fetch record whose request is request. -

      3. Set deferredRecord's inactive timeout to - inactiveTimeout. +

      4. Set deferredRecord's inactivity deferred delay + to inactivityDeferredDelay.

      5. Append deferredRecord to request's client's fetch group's @@ -8595,22 +8596,22 @@ with a promise, request, responseObject, and an

      -

      RequestDeferredFetch method

      +

      FetchLater method

       
       dictionary DeferredRequestInit : RequestInit {
      -  DOMHighResTimeStamp inactiveTimeout;
      +  DOMHighResTimeStamp backgroundTimeout;
       };
       
       partial interface mixin WindowOrWorkerGlobalScope {
      -  [NewObject] Promise<Response> requestDeferredFetch(RequestInfo input, optional DeferredRequestInit init = {});
      +  [NewObject] Promise<Response> fetchLater(RequestInfo input, optional DeferredRequestInit init = {});
       };
       
      -
      +

      The -requestDeferredFetch(input, init) +fetchLater(input, init) method steps are:

        @@ -8626,16 +8627,16 @@ method steps are:
      1. Let request be requestObject's request. -

      2. Let inactiveTimeout be null. +

      3. Let backgroundTimeout be null. -

      4. If init is given and init["inactiveTimeout"] - exists then set inactiveTimeout to - init["inactiveTimeout"]. +

      5. If init is given and init["backgroundTimeout"] + exists then set backgroundTimeout to + init["backgroundTimeout"]. -

      6. If inactiveTimeout is not a {{DOMHighResTimeStamp}} then throw a {{TypeError}}. +

      7. If backgroundTimeout is not a {{DOMHighResTimeStamp}} then throw a {{TypeError}}.

      8. Let deferredRecord be the result of calling - request a deferred fetch given request and inactiveTimeout. If that + request a deferred fetch given request and backgroundTimeout. If that threw an exception, reject promise with that exception and return promise.