diff --git a/spec/service_worker/index.html b/spec/service_worker/index.html index 4d5efaed..79bfab1e 100644 --- a/spec/service_worker/index.html +++ b/spec/service_worker/index.html @@ -321,7 +321,7 @@

postMessage(message, transfer)

  • Else if globalObject is a Window object, let the source attribute of e be initialized to a new WindowClient object that represents globalObject's browsing context.
  • Else, let it be initialized to a new Client object that represents globalObject's worker environment.
  • Let the ports attribute of e be initialized to newPorts.
  • -
  • Dispatch e at destination.
  • +
  • Dispatch e at destination.
  • The task must use the DOM manipulation task source.

    @@ -873,7 +873,7 @@

    ServiceWorkerGlobalScope

    }; -

    A ServiceWorkerGlobalScope object represents the global execution context of a service worker. A ServiceWorkerGlobalScope object has an associated service worker (a service worker).

    +

    A ServiceWorkerGlobalScope object represents the global execution context of a service worker. A ServiceWorkerGlobalScope object has an associated service worker (a service worker). A ServiceWorkerGlobalScope object has an associated importscripts allowed flag. It is initially unset.

    ServiceWorkerGlobalScope object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully registered, a service worker is started, kept alive and killed by their relationship to events, not service worker clients. Any type of synchronous requests must not be initiated inside of a service worker.

    The close() method inherited from WorkerGlobalScope, when called on the context object, should throw an "InvalidAccessError" exception.

    @@ -1046,7 +1046,7 @@

    postMessage(message, transfer)

  • Let the origin attribute of e be initialized to the Unicode serialisation of the origin specified by the incumbent settings object.
  • Let the source attribute of e be initialized to a ServiceWorker object, setting its service worker client to destination's service worker client, which represents the service worker associated with the global object specified by the incumbent settings object.
  • Let the ports attribute of e be initialized to newPorts.
  • -
  • Dispatch e at destination.
  • +
  • Dispatch e at destination.
  • The task must use the DOM manipulation task source, and, for those where the event loop specified by the target ServiceWorkerContainer object's service worker client is a browsing context event loop, must be associated with the responsible document specified by that target ServiceWorkerContainer object's service worker client.

    @@ -2246,7 +2246,17 @@

    importScripts(urls)

    The importScripts(urls) method is defined on the WorkerGlobalScope interface. The following algorithm steps monkey patch the method to embrace the service worker environment. The corresponding change request has been filed in HTML: Issue 28737.

    -

    When the importScripts(urls) method is called on a ServiceWorkerGlobalScope object, the following steps, or their equivalent, must be run replacing the step 5 of importScripts(urls):

    +

    When the importScripts(urls) method is called on a ServiceWorkerGlobalScope object, the following steps, or their equivalent, must be run as follows.

    + +

    The following steps, or their equivalent, must be run preceded by the step 1 of importScripts(urls):

    + + +
      +
    1. If the incumbent settings object's global object's importscripts allowed flag is unset, throw an "InvalidStateError" exception and abort these steps.
    2. +
    +
    + +

    The following steps, or their equivalent, must be run replacing the step 5 of importScripts(urls):

      @@ -2281,14 +2291,6 @@

      importScripts(urls)

    - -

    The following step, or its equivalent, must be run as the step 7 of importScripts(urls):

    - - -
      -
    1. Set serviceWorker's imported scripts updated flag if all the attempts have succeeded without any error.
    2. -
    -
    @@ -2672,7 +2674,7 @@

    Install

  • Queue a task task to run the following substeps:
    1. Create a trusted event e that uses the ExtendableEvent interface, with the event type install, which does not bubble, is not cancelable, and has no default action.
    2. -
    3. Dispatch e at installingWorker's environment settings object's global object.
    4. +
    5. Dispatch e at installingWorker's environment settings object's global object globalObject. During the execution of dispatch algorithm, set globalObject's importscripts allowed flag when e's dispatch flag is set, and unset globalObject's importscripts allowed flag when e's dispatch flag is unset.
    6. Let extendLifetimePromises be an empty array.
    7. For each event listener invoked:
        @@ -2739,6 +2741,7 @@

        Install

      1. Abort these steps.
    8. +
    9. Set registration's installing worker's imported scripts updated flag.
    10. If registration's waiting worker is not null, then:
      1. Terminate registration's waiting worker.
      2. @@ -2846,7 +2849,7 @@

        Activate

      3. Queue a task task to run the following substeps:
        1. Create a trusted event e that uses the ExtendableEvent interface, with the event type activate, which does not bubble, is not cancelable, and has no default action.
        2. -
        3. Dispatch e at activeWorker's environment settings object's global object.
        4. +
        5. Dispatch e at activeWorker's environment settings object's global object.
        6. Let extendLifetimePromises be an empty array.
        7. For each event listener invoked:
            @@ -2982,7 +2985,7 @@

            Handle Fetch

          1. Else, set c to a Client object that represents request's client.
          2. Let the client attribute of e be initialized to c.
          3. Let the isReload attribute of e be initialized to true if request's client is a window client and the event was dispatched with the user's intention for the page reload, and false otherwise.
          4. -
          5. Dispatch e at activeWorker's environment settings object's global object.
          6. +
          7. Dispatch e at activeWorker's environment settings object's global object.
          8. For each event listener invoked:
            1. If any uncaught runtime script error occurs, then: