-
Notifications
You must be signed in to change notification settings - Fork 670
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
Use Web IDL's new-ish interface mixins concept #2566
Conversation
WebIDL recently introduced dedicated syntax for mixins [1]. This replaces the existing [NoInterfaceObject] and "implements" syntax with "interface mixin" and "includes" in the appropriate places. This fixes KhronosGroup#2538, KhronosGroup#2539 issues. [1] whatwg/webidl@45e8173
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Confirmed that the .idl files are exactly what the Makefiles generate from the HTML.
@jdashg in particular any comments?
All of the WebGL extension interfaces also use |
It used to be that But the extensions aren't mixins - they're legacy uses of |
The intent was to prevent polluting the global namespace with interfaces for each of the WebGL extensions, since the actual type of those extension objects is unimportant. We shouldn't change that decision going forward, at least in my opinion. This change seems fine to move the IDL closer toward the current Web IDL specification. Merging now since there were no objections to this specific change. |
@@ -968,12 +967,12 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3> | |||
[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray); | |||
void bindVertexArray(WebGLVertexArrayObject? array); | |||
}; | |||
WebGL2RenderingContextBase implements WebGLRenderingContextBase; | |||
WebGL2RenderingContextBase includes WebGLRenderingContextBase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So mixins cannot include other mixins. Instead you need to write:
interface WebGL2RenderingContext {};
WebGL2RenderingContext includes WebGLRenderingContextBase;
WebGL2RenderingContext includes WebGL2RenderingContextBase;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right. I'll make a follow-up PR.
@kainino0x wrote:
Added a section to WebIDL that clarifies what legacy constructs really mean, as this is something that comes up regularly and which I also found confusing when I started working on WebIDL. I hope it helps. |
Introduced `interface mixin` syntax in KhronosGroup#2566 but it's incorrect. A `interface mixin` SHOULD NOT includes another mixin. This fixes KhronosGroup#2566.
Introduced `interface mixin` syntax in KhronosGroup#2566 but it's incorrect. A `interface mixin` SHOULD NOT includes another mixin. This fixes KhronosGroup#2566.
Introduced `interface mixin` syntax in KhronosGroup#2566 but it's incorrect. A `interface mixin` SHOULD NOT includes another mixin. This fixes KhronosGroup#2566.
WebIDL recently introduced dedicated syntax for mixins [1]. This replaces the existing [NoInterfaceObject] and "implements" syntax with "interface mixin" and "includes" in the appropriate places. This fixes KhronosGroup#2538, KhronosGroup#2539 issues. [1] whatwg/webidl@45e8173
Introduced `interface mixin` syntax in KhronosGroup#2566 but it's incorrect. A `interface mixin` SHOULD NOT includes another mixin. This fixes KhronosGroup#2566.
WebIDL recently introduced dedicated syntax for mixins [1]. This
replaces the existing [NoInterfaceObject] and "implements" syntax with
"interface mixin" and "includes" in the appropriate places.
This fixes #2538, fixes #2539 issues.
[1] whatwg/webidl@45e8173