Skip to content

Commit b4add25

Browse files
jungkeesjakearchibald
authored andcommitted
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: whatwg/dom#653.
1 parent 78fad94 commit b4add25

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docs/index.bs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
193193
<section>
194194
<h4 id="service-worker-events">Events</h4>
195195

196-
Service Workers specification defines <dfn export id="dfn-lifecycle-events">lifecycle events</dfn> (each of which is an [=event=]), {{install!!event}} and {{activate!!event}}. Service Workers and other specifications that <a href="#extensibility">extend</a> Service Workers define set of events called <dfn export id="dfn-functional-events">functional events</dfn> (each of which is an [=event=]) including {{fetch!!event}}. (See the <a href="#execution-context-events">list</a> of [=lifecycle events=] and [=functional events=].)
196+
The Service Workers specification defines <dfn export id="dfn-service-worker-events">service worker events</dfn> (each of which is an [=event=]) that include (see the <a href="#execution-context-events">list</a>):
197+
* <dfn export id="dfn-lifecycle-events">Lifecycle events</dfn>: {{install!!event}} and {{activate!!event}}.
198+
* <dfn export id="dfn-functional-events">Functional events</dfn>: {{fetch!!event}} and the [=events=] defined by other specifications that <a href="#extensibility">extend</a> the Service Workers specification. (See the <a href="#execution-context-events">list</a>.)
199+
* {{message!!event}} and {{messageerror!!event}}.
197200
</section>
198201
</section>
199202

@@ -1613,7 +1616,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
16131616
<section>
16141617
<h3 id="execution-context-events">Events</h3>
16151618

1616-
The following events are dispatched on {{ServiceWorkerGlobalScope}} object:
1619+
The following events, called [=service worker events=], are dispatched on {{ServiceWorkerGlobalScope}} object:
16171620

16181621
<table class="data" dfn-for="ServiceWorkerGlobalScope">
16191622
<thead>

docs/v1/index.bs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
182182
<section>
183183
<h4 id="service-worker-events">Events</h4>
184184

185-
Service Workers specification defines <dfn export id="dfn-lifecycle-events">lifecycle events</dfn> (each of which is an [=event=]), {{install!!event}} and {{activate!!event}}. Service Workers and other specifications that <a href="#extensibility">extend</a> Service Workers define set of events called <dfn export id="dfn-functional-events">functional events</dfn> (each of which is an [=event=]) including {{fetch!!event}}. (See the <a href="#execution-context-events">list</a> of [=lifecycle events=] and [=functional events=].)
185+
The Service Workers specification defines <dfn export id="dfn-service-worker-events">service worker events</dfn> (each of which is an [=event=]) that include (see the <a href="#execution-context-events">list</a>):
186+
* <dfn export id="dfn-lifecycle-events">Lifecycle events</dfn>: {{install!!event}} and {{activate!!event}}.
187+
* <dfn export id="dfn-functional-events">Functional events</dfn>: {{fetch!!event}} and the [=events=] defined by other specifications that <a href="#extensibility">extend</a> the Service Workers specification. (See the <a href="#execution-context-events">list</a>.)
188+
* {{message!!event}} and {{messageerror!!event}}.
186189
</section>
187190
</section>
188191

@@ -1493,7 +1496,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
14931496
<section>
14941497
<h3 id="execution-context-events">Events</h3>
14951498

1496-
The following events are dispatched on {{ServiceWorkerGlobalScope}} object:
1499+
The following events, called [=service worker events=], are dispatched on {{ServiceWorkerGlobalScope}} object:
14971500

14981501
<table class="data" dfn-for="ServiceWorkerGlobalScope">
14991502
<thead>
@@ -2354,7 +2357,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
23542357
<p>Note: This step has two known issues.</p>
23552358
<p>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.</p>
23562359
<p>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.</p>
2357-
<p>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/).</p>
2360+
<p>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/).</p>
23582361
</div>
23592362

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

0 commit comments

Comments
 (0)