Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain the list of functional events #1322

Merged
merged 3 commits into from
Jun 15, 2018
Merged

Conversation

jungkees
Copy link
Collaborator

@jungkees jungkees commented Jun 6, 2018

This adds the functional events defined by other specifications to the list of
events section of the spec. This change is to make the context clearer when
specifications refer to the functional event concept.

E.g. Fetch needs a reference to it: whatwg/dom#371 (comment).


Preview | Diff

This adds the functional events defined by other specifications to the list of
events section of the spec. This change is to make the context clearer when
specifications refer to the functional event concept.

E.g. Fetch needs a reference to it: whatwg/dom#371 (comment).
jungkees added a commit to jungkees/dom that referenced this pull request Jun 6, 2018
This changes addEventListener() and removeEventListener() to not throw even
after the very first evalution of the service worker script. Instead, this
specifies user agents have to show a console warning that the asynchronously
added listener's event type will not affect service worker's behavior with the
functional event stored during the first evaluation.

This change referneces the funcional event concept defined in Service Workers
spec, and confines the EventTarge object of the specified behavior to
ServiceWorkerGlobalScope object instead of all the platform object in the global
object.

Related SW issue: w3c/ServiceWorker#1004.
Related SW PR: w3c/ServiceWorker#1322.
Fixes whatwg#371.
docs/index.bs Outdated
@@ -139,7 +139,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
<section dfn-for="service worker">
<h3 id="service-worker-concept">Service Worker</h3>

A <dfn export id="dfn-service-worker" for="">service worker</dfn> is a type of <a>web worker</a>. A [=/service worker=] executes in the registering [=/service worker client=]'s [=/origin=].
A <dfn export id="dfn-service-worker" for="">service worker</dfn> is a type of <a>web worker</a>. A [=/service worker=] executes in the registering [=/service worker client=]'s [=/origin=]. [=/Service workers=] define <dfn export id="dfn-lifecycle-events">lifecycle events</dfn>, {{install!!event}} and {{activate!!event}}. [=/Service workers=] and specifications that <a href="#extensibility">extend</a> [=/service Workers=] define set of events called <dfn export id="dfn-functional-events">functional events</dfn> including {{fetch!!event}}. (See the <a href="#execution-context-events">list</a> of [=lifecycle events=] and [=functional events=].)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence is a bit confusing as it mixes "service worker" the concept with "Service Worker" the specification. A specification defines things. A concept is and has things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by clarifying the spec defines the lifecycle events and the functional events.

Copy link
Contributor

@jakearchibald jakearchibald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jungkees jungkees merged commit 19bac05 into master Jun 15, 2018
@jungkees jungkees deleted the clarify-sw-event-categories branch June 15, 2018 05:26
annevk pushed a commit to jungkees/dom that referenced this pull request Nov 1, 2019
This changes addEventListener() and removeEventListener() to not throw even
after the very first evalution of the service worker script. Instead, this
specifies user agents have to show a console warning that the asynchronously
added listener's event type will not affect service worker's behavior with the
functional event stored during the first evaluation.

This change referneces the funcional event concept defined in Service Workers
spec, and confines the EventTarge object of the specified behavior to
ServiceWorkerGlobalScope object instead of all the platform object in the global
object.

Related SW issue: w3c/ServiceWorker#1004.
Related SW PR: w3c/ServiceWorker#1322.
Fixes whatwg#371.
annevk pushed a commit to whatwg/dom that referenced this pull request Nov 4, 2019
This changes addEventListener() and removeEventListener() to not throw even after the very first evalution of the service worker script. Instead, this specifies user agents have to show a console warning.

Related: w3c/ServiceWorker#1004 and w3c/ServiceWorker#1322.

Tests: web-platform-tests/wpt#19496.

Fixes #371.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants