css-houdini-drafts
css-houdini-drafts copied to clipboard
[worklets] Allow lazy construction of WorkletGlobalScope.
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.
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.