-
Notifications
You must be signed in to change notification settings - Fork 142
[css-animation-worklet] IDL for AnimationWorkletGlobalScope is invalid #907
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
Comments
This should have been covered/caught in the Will address with web-platform-tests/wpt#17551 |
Thanks for catching this. I will fix this in the spec per your proposed solution which makes sense. I will ask some of our more seasoned spec writers to do a check on the spec to ensure we catch other mistakes like this as well. |
So just to be clear. Is it enough that we do A) expand global list for [Exposed=Worklet]
interface WorkletGlobalScope {};
[ Exposed=AnimationWorklet, Global=(AnimationWorklet, Worklet) ]
interface AnimationWorkletGlobalScope : WorkletGlobalScope {} or do I also need to do B) expand exposure set of [Exposed=(AnimationWorklet, Worklet)]
interface WorkletGlobalScope {};
[ Exposed=AnimationWorklet, Global=(AnimationWorklet, Worklet) ]
interface AnimationWorkletGlobalScope : WorkletGlobalScope {} If I understand correctly the original comment suggests that (A) is sufficient because by making |
(A) is enough. |
Phew, I've had to reread the sections on Exposed and Global multiple times before I finally understood what was going on here. So, Second, it advertises one or more names that other interfaces can use in So WorkletGlobalScope and its subclasses are mixing two different "inheritance" systems here. First, WGS itself is an "abstract" superclass of all the specific worklet globals, like AnimationWorkletGlobalScope or PaintWorkletGlobalScope, so we can define methods there that'll show up in all the worklet globals. Then the specific subclasses actually mark themselves as globals, advertising both a specific name and the generic name "Worklet", so that interfaces/methods/etc can choose to expose themselves either to a specific worklet type, or to all worklets.
I feel like this example should really be illustrated in WebIDL; it's used by both Workers and Worklets, but is (to me, at least) a very non-obvious twisty sort of interaction of these features. Compare to the much simpler Window example, which is a global and exposed to itself immediately. I'll open an issue for this. |
The IDL says:
but the definition of
WorkletGlobalScope
at https://drafts.css-houdini.org/worklets/#the-global-scope says:So
WorkeltGlobalScope
is only exposed in "Worklet" scopes,AnimationWorkletGlobalScope
is not a "Worklet" scope, and the IDL spec says:In this case that condition is violated.
You probably want
Global=(AnimationWorklet, Worklet)
here.The text was updated successfully, but these errors were encountered: