Re: [whatwg/fetch] Adds "audioworklet" and "paintworklet" as destinations. (#527)

I looked at the spec further and the Fetch request Client is already spec'd to be the outer document's Client.

The "outer settings" are passed to the module loading algorithm in step 1 here:

https://drafts.css-houdini.org/worklets/#fetch-a-worklet-script

So I agree the owner document's service worker should be used.  The FetchEvent.clientId in that case will be the owner document's Client Id.

Conceptually worklets seem to be similar to:

```
// Global is created as an empty opaque origin global
let w = new Worker('data:application/javascript,self.onmessage = evt => eval(evt.data);');

// Owner document does the fetching
let response = await fetch(scriptURL);
let scriptText = await response.text();

// Resulting script is evaluated in the opaqu origin global
w.postMessage(scriptText);
```

Anyway, sorry for my confusion.  The way worklets were being conflated with dedicated workers elsewhere confused me.  The spec does clearly state that the owner is doing the fetching and not the worklet global itself.

So I agree with: https://github.com/whatwg/fetch/pull/527#issuecomment-335854430

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/527#issuecomment-335873521

Received on Wednesday, 11 October 2017 16:48:20 UTC