diff --git a/docs/index.bs b/docs/index.bs index 50e65e65..6c8f8c53 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -999,6 +999,8 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231

A {{Client}} object has an associated service worker client (a service worker client).

+

A {{Client}} object has an associated reserved state, which is either true or false.

+

A {{WindowClient}} object has an associated visibility state, which is one of {{Document/visibilityState}} attribute value.

A {{WindowClient}} object has an associated focus state, which is either true or false (initially false).

@@ -1020,7 +1022,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231

{{Client/reserved}}

-

The reserved attribute must return true if the context object's associated service worker client's execution ready flag is unset, and false otherwise.

+

The reserved attribute must return the context object's associated reserved state.

Defining the execution ready flag is a work in progress. See the pull request to HTML.

@@ -4011,6 +4013,7 @@ spec: rfc7231; urlPrefix: https://tools.ietf.org/html/rfc7231
  1. Let clientObject be a new {{Client}} object.
  2. Set clientObject's service worker client to client.
  3. +
  4. Set clientObject's reserved state to true if client's execution ready flag is unset, and false otherwise.
  5. Return clientObject.
diff --git a/docs/index.html b/docs/index.html index 862d2bb0..61ac96e0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1422,7 +1422,7 @@

Service Workers Nightly

-

Editor’s Draft,

+

Editor’s Draft,

This version: @@ -2397,6 +2397,7 @@

Client object has an associated service worker client (a service worker client).

+

A Client object has an associated reserved state, which is either true or false.

A WindowClient object has an associated visibility state, which is one of visibilityState attribute value.

A WindowClient object has an associated focus state, which is either true or false (initially false).

A WindowClient object has an associated ancestor origins array.

@@ -2410,7 +2411,7 @@

4.2.3. reserved

-

The reserved attribute must return true if the context object’s associated service worker client’s execution ready flag is unset, and false otherwise.

+

The reserved attribute must return the context object’s associated reserved state.

Defining the execution ready flag is a work in progress. See the pull request to HTML.

@@ -2418,7 +2419,7 @@

The postMessage(message, transfer) method must run these steps:

  1. Let sourceSettings be the context object’s relevant settings object. -
  2. Let destination be the ServiceWorkerContainer object whose service worker client is the context object’s service worker client. +
  3. Let destination be the ServiceWorkerContainer object whose service worker client is the context object’s service worker client.
  4. If destination is null, throw an "InvalidStateError" exception.
  5. Let targetRealm be destination’s relevant Realm.
  6. Let cloneRecord be StructuredCloneWithTransfer(message, transfer, targetRealm). If this throws an exception, rethrow that exception and abort these steps. @@ -2446,7 +2447,7 @@

    4.2.7. ancestorOrigins

    -

    The ancestorOrigins attribute must return the context object’s associated service worker client’s ancestor origins array.

    +

    The ancestorOrigins attribute must return the context object’s associated service worker client’s ancestor origins array.

4.2.8. focus()

@@ -2457,12 +2458,12 @@

in parallel:
    -
  1. Let browsingContext be the context object’s associated service worker client’s global object’s browsing context. +
  2. Let browsingContext be the context object’s associated service worker client’s global object’s browsing context.
  3. Let visibilityState be null.
  4. Let focusState be false.
  5. Let ancestorOrigins be the empty array.
  6. - Queue a task task to run the following substeps on the context object’s associated service worker client’s responsible event loop using the user interaction task source: + Queue a task task to run the following substeps on the context object’s associated service worker client’s responsible event loop using the user interaction task source:
    1. Run the focusing steps with browsingContext.
    2. Set visibilityState to browsingContext’s active document’s visibilityState attribute value. @@ -2470,7 +2471,7 @@

      active document’s relevant global object’s Location object’s ancestor origins array.

  7. Wait for task to have executed. -
  8. Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments. +
  9. Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments.
  10. If windowClient’s focus state is true, resolve promise with windowClient.
  11. Else, reject promise with a TypeError.
@@ -2484,19 +2485,19 @@

Let url be the result of parsing url with the context object’s relevant settings object’s API base URL.
  • If url is failure, return a promise rejected with a TypeError.
  • If url is about:blank, return a promise rejected with a TypeError. -
  • If the context object’s associated service worker client’s active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError. +
  • If the context object’s associated service worker client’s active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError.
  • Let promise be a new promise.
  • Run these substeps in parallel:
      -
    1. Let browsingContext be the context object’s associated service worker client’s global object’s browsing context. +
    2. Let browsingContext be the context object’s associated service worker client’s global object’s browsing context.
    3. If browsingContext has discarded its Document, reject promise with a TypeError and abort these steps.
    4. Let navigateFailed to false.
    5. Let visibilityState be null.
    6. Let focusState be false.
    7. Let ancestorOrigins be the empty array.
    8. - Queue a task task to run the following substeps on the context object’s associated service worker client’s responsible event loop using the user interaction task source: + Queue a task task to run the following substeps on the context object’s associated service worker client’s responsible event loop using the user interaction task source:
      1. HandleNavigate: Navigate browsingContext to url with exceptions enabled. The source browsing context must be browsingContext.
      2. If the algorithm steps invoked in the step labeled HandleNavigate throws an exception, set navigateFailed to true. @@ -2525,7 +2526,7 @@

        interface Clients { // The objects returned will be new instances every time [NewObject] Promise<any> get(DOMString id); - [NewObject] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options); + [NewObject] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options); [NewObject] Promise<WindowClient?> openWindow(USVString url); [NewObject] Promise<void> claim(); }; @@ -2675,9 +2676,9 @@

        WindowClient objects are always placed before Client objects whose associated service worker clients are worker clients. -
      3. WindowClient objects that have been focused are placed first sorted in the most recently focused order, and WindowClient objects that have never been focused are placed next sorted in their service worker clients' creation order. -
      4. Client objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order. +
      5. WindowClient objects are always placed before Client objects whose associated service worker clients are worker clients. +
      6. WindowClient objects that have been focused are placed first sorted in the most recently focused order, and WindowClient objects that have never been focused are placed next sorted in their service worker clients' creation order. +
      7. Client objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order.
      8. Resolve promise with matchedClients.
      @@ -3151,7 +3152,7 @@

      readonly attribute any data; readonly attribute USVString origin; readonly attribute DOMString lastEventId; - [SameObject] readonly attribute (Client or ServiceWorker or MessagePort)? source; + [SameObject] readonly attribute (Client or ServiceWorker or MessagePort)? source; readonly attribute FrozenArray<MessagePort> ports; }; @@ -3159,7 +3160,7 @@

      any data = null; USVString origin = ""; DOMString lastEventId = ""; - (Client or ServiceWorker or MessagePort)? source = null; + (Client or ServiceWorker or MessagePort)? source = null; sequence<MessagePort> ports = []; }; @@ -3178,7 +3179,7 @@

      4.8.4. event.source

      -

      The source attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to null. It represents the Client object from which the message is sent.

      +

      The source attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to null. It represents the Client object from which the message is sent.

  • 4.8.5. event.ports

    @@ -5076,11 +5077,12 @@

    C
    Input
    client, a service worker client
    Output -
    clientObject, a Client object +
    clientObject, a Client object

      -
    1. Let clientObject be a new Client object. -
    2. Set clientObject’s service worker client to client. +
    3. Let clientObject be a new Client object. +
    4. Set clientObject’s service worker client to client. +
    5. Set clientObject’s reserved state to true if client’s execution ready flag is unset, and false otherwise.
    6. Return clientObject.
    @@ -5097,7 +5099,7 @@

    WindowClient object. -
  • Set windowClient’s service worker client to client. +
  • Set windowClient’s service worker client to client.
  • Set windowClient’s visibility state to visibilityState.
  • Set windowClient’s focus state to focusState.
  • Set windowClient’s ancestor origins array to ancestorOrigins. @@ -5636,6 +5638,7 @@

    dict-member for FetchEventInit, in §4.6
  • attribute for FetchEvent, in §4.6.3 +
  • reserved state, in §4.2
  • respond-with entered flag + + +