css-houdini-drafts icon indicating copy to clipboard operation
css-houdini-drafts copied to clipboard

[worklets] Allow lazy construction of WorkletGlobalScope.

Open hoch opened this issue 7 years ago • 1 comments

In the section 2.2, the step 10 in the algorithm:

If the worklet’s WorkletGlobalScopes is empty, run the following steps:
1. Create a WorkletGlobalScope given workletGlobalScopeType, moduleResponsesMap, 
   and outsideSettings.
2. Add the WorkletGlobalScope to worklet’s WorkletGlobalScopes.

For AudioWorklet, the worklet global scope is associated with BaseAudioContext and it should be created when the context is constructed. The current spec text does not allow that.

hoch avatar Jun 28 '17 15:06 hoch

This is about the step in addModule(), right? How would you call addModule() before creating the BaseAudioContext? It seems like as long as the Web Audio specification takes care to call "create a worklet global scope" when the BaseAudioContext is created, then this step will just be skipped, since it will never be empty.

domenic avatar Oct 16 '20 18:10 domenic