Skip to content

Commit

Permalink
Use Web IDL's new-ish interface mixins concept (KhronosGroup#2566)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
romandev authored and kenrussell committed Jan 4, 2018
1 parent 57590ed commit 2df151b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
5 changes: 2 additions & 3 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
typedef ([AllowShared] Float32Array or sequence&lt;GLfloat&gt;) Float32List;
typedef ([AllowShared] Int32Array or sequence&lt;GLint&gt;) Int32List;

[NoInterfaceObject]
interface <dfn id="WebGLRenderingContextBase">WebGLRenderingContextBase</dfn>
interface mixin <dfn id="WebGLRenderingContextBase">WebGLRenderingContextBase</dfn>
{

/* ClearBufferMask */
Expand Down Expand Up @@ -1873,7 +1872,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
interface <dfn id="WebGLRenderingContext">WebGLRenderingContext</dfn>
{
};
WebGLRenderingContext implements WebGLRenderingContextBase;
WebGLRenderingContext includes WebGLRenderingContextBase;
</pre>

<!-- ======================================================================================================= -->
Expand Down
5 changes: 2 additions & 3 deletions specs/latest/1.0/webgl.idl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ typedef (ImageBitmap or
typedef ([AllowShared] Float32Array or sequence<GLfloat>) Float32List;
typedef ([AllowShared] Int32Array or sequence<GLint>) Int32List;

[NoInterfaceObject]
interface WebGLRenderingContextBase
interface mixin WebGLRenderingContextBase
{

/* ClearBufferMask */
Expand Down Expand Up @@ -716,7 +715,7 @@ interface WebGLRenderingContextBase
interface WebGLRenderingContext
{
};
WebGLRenderingContext implements WebGLRenderingContextBase;
WebGLRenderingContext includes WebGLRenderingContextBase;


[Constructor(DOMString type, optional WebGLContextEventInit eventInit)]
Expand Down
7 changes: 3 additions & 4 deletions specs/latest/2.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
<pre class="idl">
typedef ([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) Uint32List;

[NoInterfaceObject]
interface <dfn id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
interface mixin <dfn id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
{
const GLenum READ_BUFFER = 0x0C02;
const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
Expand Down Expand Up @@ -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;

interface <dfn id="WebGL2RenderingContext">WebGL2RenderingContext</dfn>
{
};
WebGL2RenderingContext implements WebGL2RenderingContextBase;
WebGL2RenderingContext includes WebGL2RenderingContextBase;

</pre>

Expand Down
7 changes: 3 additions & 4 deletions specs/latest/2.0/webgl2.idl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ interface WebGLVertexArrayObject : WebGLObject {

typedef ([AllowShared] Uint32Array or sequence<GLuint>) Uint32List;

[NoInterfaceObject]
interface WebGL2RenderingContextBase
interface mixin WebGL2RenderingContextBase
{
const GLenum READ_BUFFER = 0x0C02;
const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
Expand Down Expand Up @@ -571,11 +570,11 @@ interface WebGL2RenderingContextBase
[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
void bindVertexArray(WebGLVertexArrayObject? array);
};
WebGL2RenderingContextBase implements WebGLRenderingContextBase;
WebGL2RenderingContextBase includes WebGLRenderingContextBase;

interface WebGL2RenderingContext
{
};
WebGL2RenderingContext implements WebGL2RenderingContextBase;
WebGL2RenderingContext includes WebGL2RenderingContextBase;


0 comments on commit 2df151b

Please sign in to comment.