-
Notifications
You must be signed in to change notification settings - Fork 312
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
Conversation
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).
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=].) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
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.
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