-
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
Behavior of the onfetch setter regarding no-fetch service workers #1004
Comments
This should be fixed together with whatwg/dom#371. |
Thanks for spotting. I'll follow up on this after clarifying whatwg/dom#371. |
What's the status here @jungkees? Would be good to sort this out. |
Yeah, the idea is to add the following step to the above places: "Throw when T is a ServiceWorkerGlobalScope object, type is an event type in the while list, and the SW's has ever been evaluated flag is set." But this isn't decided yet. We should conclude what the better design would be in whatwg/dom#371. |
This hook ensures that any special casing in addEventListener() is shared with event handler attributes. Helps with w3c/ServiceWorker#1004.
See whatwg/dom#596 and whatwg/dom#365 and w3c/ServiceWorker#1004 for more context.
Since nobody else took this up I wrote the necessary patches for DOM and HTML. |
This hook ensures that any special casing in addEventListener() is shared with event handlers. This commit also makes numerous editorial improvements that were long overdue around dictionary members. The corresponding change to the HTML Standard, which defines event handlers, is tracked by whatwg/html#3561. This helps with #365 and w3c/ServiceWorker#1004. (Tests will be added as part of #365 eventually.)
This hook was provided whatwg/dom#596 and event handlers need to use it to fix whatwg/dom#365 and w3c/ServiceWorker#1004 properly. Tests will be added as part of resolving those issues.
OP is now addressed, but I think we should leave this open until someone has addressed the questions I raised in whatwg/dom#371 and there's tests covering exactly what we want to be doing here. |
@annevk, thanks for helping out with this issue. I leave a comment here as the PRs have already been merged. Through the discussion in whatwg/dom#371, we decided to confine the event target to |
Well, that issue isn't fixed yet and that decision is being contested by bz in that issue. That's why that text hasn't been touched thus far. |
Also, are there any tests? |
That bit was posed by the OP: whatwg/dom#371 (comment). Allowing the event target to be any object doesn't make sense, and the proposed change is in the direction of a solution. I'll need to check out for tests. |
I think throwing in general doesn't make sense, even for the global object. As bz points out, you could have custom events that you might want to register at a later time. |
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 hook was provided whatwg/dom#596 and event handlers need to use it to fix whatwg/dom#365 and w3c/ServiceWorker#1004 properly. Tests will be added as part of resolving those issues.
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.
Closing via whatwg/html@9a2a66c, web-platform-tests/wpt@bc28ef5, and whatwg/dom#653. |
With the changes discussed in #718 addEventListener should throw unless called during the script's initial evaluation. What should be the behavior of setting the onfetch event handler?
I'm guessing it should throw as well, but this was not included in the spec.
from https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes
This can be changed to use addEventListener for adding the event listener.
The text was updated successfully, but these errors were encountered: