New issue
Advanced search Search tips

Issue 697147 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Compat

Blocked on:
issue 701457

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment

Remove ServiceWorkerGlobalScope#fetch

Project Member Reported by lunalu@chromium.org, Feb 28 2017

Issue description

It seems like this fetch is not in the spec, and onfetch is handling HTTP fetch (the fetch event is defined here https://w3c.github.io/ServiceWorker/#fetchevent-interface). 
Should we remove this fetch API in ServiceWorkerGlobalScope? Or should we add it to the spec?
 

Comment 1 by bke...@mozilla.com, Feb 28 2017

ServiceWorkerGlobalScope gets fetch() from WorkerGlobalScope implementing WindowOrWorkerGlobalScope:

https://fetch.spec.whatwg.org/#fetch-method
https://html.spec.whatwg.org/#windoworworkerglobalscope-mixin

Comment 2 by lunalu@chromium.org, Feb 28 2017

Description: Show this description

Comment 3 by lunalu@chromium.org, Feb 28 2017

Cc: domenic@chromium.org
But WorkerGlobalScope doesn't have fetch, even though WindowOrWorkerGlobalScope does. It doesn't seem like there's a link between the two of them. Should WorkerGlobalScope inherits from WindowOrWorkerGlobalScope?

Also, we need to include the spec links to fetch in ServiceWorkerGlobalScope.idl

Comment 4 by lunalu@chromium.org, Feb 28 2017

Never mind, I didn't see 
Window implements WindowOrWorkerGlobalScope;
WorkerGlobalScope implements WindowOrWorkerGlobalScope;
in the spec.

But shouldn't we be moving fetch from ServiceWorkerGlobalScope to WorkerGlobalScope or even higher?

Comment 5 by mek@chromium.org, Feb 28 2017

WorkerFetch (implemented as GlobalFetch) defines fetch on partial interface WorkerGlobalScope (and the ServiceWorkerGlobalScope fetch override just calls the GlobalFetch version anyway, so removing that should have no effect afaict).
Cc: foolip@chromium.org
Labels: -Type-Bug Type-Compat
Status: Available (was: Untriaged)

Comment 8 by ricea@chromium.org, Mar 21 2017

Components: Blink>Network>FetchAPI
I have confirmed it is defined in Blink here:

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl

But is the difference actually visible to user code?

Comment 9 by foolip@chromium.org, Mar 21 2017

These two partial interfaces together should be identical to what the spec says, and could probably be refactored into a "partial interface WindowOrWorkerGlobalScope" if one was so inclined:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/fetch/WindowFetch.idl
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/fetch/WorkerFetch.idl

The override in ServiceWorkerGlobalScope is in addition to what's required to exist in the spec, and may be observable to scripts. The ServiceWorkerGlobalScope interface looks like it's exposed, and maybe ServiceWorkerGlobalScope.prototype.hasOwnProperty('fetch') returns true when it shouldn't?
Owner: nhiroki@chromium.org
Status: Assigned (was: Available)
I'm interested in this issue.

Work items:
1) Add WindowOrWorkerGlobalScope.idl into core/frames, and move the common attrs/functions between Window.idl and WorkerGlobalScope.idl into WindowOrWorkerGlobalScope.idl (e.g., 'origin' attr)
2) Implement "partial interface WindowOrWorkerGlobalScope" under modules/fetch and remove WindowFetch.idl and WorkerFetch.idl.
3) Remove fetch() from ServiceWorkerGlobalScope.idl.
WindowOrWorkerGlobalScope.idl will be added by https://codereview.chromium.org/2798433003/
Cc: nhiroki@chromium.org
Owner: ----
Status: Available (was: Assigned)
I meant to forward this issue to a 20% contributor but she is now busy with other issues, so let me return this to the shelf for now...
Blockedon: 701457
Labels: Hotlist-Interop

Sign in to add a comment