From b4add25149559ca48245633c0dc045e88ec23d9b Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Fri, 9 Aug 2019 04:18:47 -0700 Subject: [PATCH] Define service worker events (#1452) This introduces the concept, service worker events, to refer to the events that are one of lifecycle events, functional events, and the legacy message events dispatched to ServiceWorkerGlobalScope. Related PR: https://github.com/whatwg/dom/pull/653. --- docs/index.bs | 7 +++++-- docs/v1/index.bs | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 669e9250..0ad25616 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -193,7 +193,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

Events

- Service Workers specification defines lifecycle events (each of which is an [=event=]), {{install!!event}} and {{activate!!event}}. Service Workers and other specifications that extend Service Workers define set of events called functional events (each of which is an [=event=]) including {{fetch!!event}}. (See the list of [=lifecycle events=] and [=functional events=].) + The Service Workers specification defines service worker events (each of which is an [=event=]) that include (see the list): + * Lifecycle events: {{install!!event}} and {{activate!!event}}. + * Functional events: {{fetch!!event}} and the [=events=] defined by other specifications that extend the Service Workers specification. (See the list.) + * {{message!!event}} and {{messageerror!!event}}.
@@ -1613,7 +1616,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

Events

- The following events are dispatched on {{ServiceWorkerGlobalScope}} object: + The following events, called [=service worker events=], are dispatched on {{ServiceWorkerGlobalScope}} object: diff --git a/docs/v1/index.bs b/docs/v1/index.bs index b4035ca1..4576028f 100644 --- a/docs/v1/index.bs +++ b/docs/v1/index.bs @@ -182,7 +182,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

Events

- Service Workers specification defines lifecycle events (each of which is an [=event=]), {{install!!event}} and {{activate!!event}}. Service Workers and other specifications that extend Service Workers define set of events called functional events (each of which is an [=event=]) including {{fetch!!event}}. (See the list of [=lifecycle events=] and [=functional events=].) + The Service Workers specification defines service worker events (each of which is an [=event=]) that include (see the list): + * Lifecycle events: {{install!!event}} and {{activate!!event}}. + * Functional events: {{fetch!!event}} and the [=events=] defined by other specifications that extend the Service Workers specification. (See the list.) + * {{message!!event}} and {{messageerror!!event}}.
@@ -1493,7 +1496,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

Events

- The following events are dispatched on {{ServiceWorkerGlobalScope}} object: + The following events, called [=service worker events=], are dispatched on {{ServiceWorkerGlobalScope}} object:
@@ -2354,7 +2357,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe

Note: This step has two known issues.

First, using the to-be-created [=environment settings object=] rather than a concrete [=environment settings object=]. This is used due to the unique processing model of service workers compared to the processing model of other [=web workers=]. The script fetching algorithms of HTML standard originally designed for other [=web workers=] require an [=environment settings object=] of the execution environment, but service workers fetch a script separately in the [=Update=] algorithm before the script later runs multiple times through the [=Run Service Worker=] algorithm.

Second, the [=fetch a classic worker script=] algorithm and the [=fetch a module worker script graph=] algorithm in HTML take |job|’s [=job/client=] as an argument. |job|’s [=job/client=] is null when passed from the [=Soft Update=] algorithm.

-

These issues are tracked in the [issue #1013](https://github.com/w3c/ServiceWorker/issues/1013) of the ServiceWorkers GitHub repository. We will address these issues in [Service Workers Nightly](https://w3c.github.io/ServiceWorker/).

+

These issues are tracked in the [issue #1013](https://github.com/w3c/ServiceWorker/issues/1013) of the Service Workers GitHub repository. We will address these issues in [Service Workers Nightly](https://w3c.github.io/ServiceWorker/).

To [=fetching scripts/perform the fetch=] given |request|, run the following steps: