Skip to content

Commit

Permalink
Markup definitions with their type (KhronosGroup#3294)
Browse files Browse the repository at this point in the history
As defined in the [definition markup contract](https://tabatkins.github.io/bikeshed/#dfn-contract) that many Web specs are adhering to - these conventions are not specific to bikeshed (they are [being moved to a document on their own](speced/bikeshed#2088 (comment))).

Adhering to these conventions makes it easier for other specifications to reference items defined in WebGL, through projects such as [webref](github.com/w3c/webref/) and [shepherd](http://hg.csswg.org/dev/shepherd/) which themseves are integrated in bikeshed and respec, widely used by other specs.

If this type of changes are acceptable and welcome, I would be happy to provide additional patches for other IDL items, at least those that are known to be referenced from other specs - if so, I might need guidance on what convention to follow to assign `id`s to these definitions.
  • Loading branch information
dontcallmedom authored Jun 29, 2021
1 parent 838dbb6 commit fec72ba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
28 changes: 14 additions & 14 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ <h3><a name="WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a></h3>
<!-- The capitalization rules here match those of the crossOrigin
attribute, which was added to HTMLMediaElement on behalf of
WebGL. -->
<pre class="idl">dictionary <dfn id="WebGLContextAttributes">WebGLContextAttributes</dfn> {
<pre class="idl">dictionary <dfn data-dfn-type="dictionary" id="WebGLContextAttributes">WebGLContextAttributes</dfn> {
boolean alpha = true;
boolean depth = true;
boolean stencil = false;
Expand Down Expand Up @@ -945,7 +945,7 @@ <h3>WebGLObject</h3>
an <b><a name="webgl-object-invalidated-flag">invalidated</a></b> flag, which is initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLObject">WebGLObject</dfn> {
interface <dfn data-dfn-type="interface" id="WebGLObject">WebGLObject</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -963,7 +963,7 @@ <h3>WebGLBuffer</h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLBuffer">WebGLBuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLBuffer">WebGLBuffer</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -981,7 +981,7 @@ <h3><a name="WEBGL_FRAMEBUFFER">WebGLFramebuffer</a></h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLFramebuffer">WebGLFramebuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLFramebuffer">WebGLFramebuffer</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -999,7 +999,7 @@ <h3>WebGLProgram</h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLProgram">WebGLProgram</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLProgram">WebGLProgram</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1017,7 +1017,7 @@ <h3>WebGLRenderbuffer</h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLRenderbuffer">WebGLRenderbuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLRenderbuffer">WebGLRenderbuffer</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1035,7 +1035,7 @@ <h3>WebGLShader</h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLShader">WebGLShader</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLShader">WebGLShader</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1053,7 +1053,7 @@ <h3>WebGLTexture</h3>
.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLTexture">WebGLTexture</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLTexture">WebGLTexture</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1065,7 +1065,7 @@ <h3>WebGLUniformLocation</h3>
in a shader program.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLUniformLocation">WebGLUniformLocation</dfn> {
interface <dfn data-dfn-type="interface" id="WebGLUniformLocation">WebGLUniformLocation</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1077,7 +1077,7 @@ <h3>WebGLActiveInfo</h3>
from the getActiveAttrib and getActiveUniform calls.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLActiveInfo">WebGLActiveInfo</dfn> {
interface <dfn data-dfn-type="interface" id="WebGLActiveInfo">WebGLActiveInfo</dfn> {
readonly attribute GLint size;
readonly attribute GLenum type;
readonly attribute DOMString name;
Expand Down Expand Up @@ -1128,7 +1128,7 @@ <h3>WebGLShaderPrecisionFormat</h3>
from the getShaderPrecisionFormat call.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLShaderPrecisionFormat">WebGLShaderPrecisionFormat</dfn> {
interface <dfn data-dfn-type="interface" id="WebGLShaderPrecisionFormat">WebGLShaderPrecisionFormat</dfn> {
readonly attribute GLint rangeMin;
readonly attribute GLint rangeMax;
readonly attribute GLint precision;
Expand Down Expand Up @@ -1296,7 +1296,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;

interface mixin <dfn id="WebGLRenderingContextBase">WebGLRenderingContextBase</dfn>
interface mixin <dfn data-dfn-type="interface" id="WebGLRenderingContextBase">WebGLRenderingContextBase</dfn>
{

/* ClearBufferMask */
Expand Down Expand Up @@ -1930,7 +1930,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
};

[Exposed=(Window,Worker)]
interface <dfn id="WebGLRenderingContext">WebGLRenderingContext</dfn>
interface <dfn data-dfn-type="interface" id="WebGLRenderingContext">WebGLRenderingContext</dfn>
{
};
WebGLRenderingContext includes WebGLRenderingContextBase;
Expand Down Expand Up @@ -3463,7 +3463,7 @@ <h3><a name="WEBGLCONTEXTEVENT">WebGLContextEvent</a></h3>
</p>
<pre class="idl">
[Exposed=(Window,Worker)]
interface <dfn id="WebGLContextEvent">WebGLContextEvent</dfn> : <a href="http://www.w3.org/TR/domcore/#event">Event</a> {
interface <dfn data-dfn-type="interface" id="WebGLContextEvent">WebGLContextEvent</dfn> : <a href="http://www.w3.org/TR/domcore/#event">Event</a> {
constructor(DOMString type, optional WebGLContextEventInit eventInit = {});
readonly attribute DOMString statusMessage;
};
Expand Down
16 changes: 8 additions & 8 deletions specs/latest/2.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ <h3>WebGLQuery</h3>
</span>.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLQuery">WebGLQuery</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLQuery">WebGLQuery</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -326,7 +326,7 @@ <h3>WebGLSampler</h3>
</span>.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLSampler">WebGLSampler</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLSampler">WebGLSampler</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand Down Expand Up @@ -364,7 +364,7 @@ <h3>WebGLSync</h3>
<p>
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLSync">WebGLSync</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLSync">WebGLSync</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -390,7 +390,7 @@ <h3>WebGLTransformFeedback</h3>
</span>.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLTransformFeedback">WebGLTransformFeedback</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLTransformFeedback">WebGLTransformFeedback</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -416,7 +416,7 @@ <h3>WebGLVertexArrayObject</h3>
</span>.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn id="WebGLVertexArrayObject">WebGLVertexArrayObject</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLVertexArrayObject">WebGLVertexArrayObject</dfn> : WebGLObject {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -431,7 +431,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
<pre class="idl">
typedef ([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) Uint32List;

interface mixin <dfn id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
interface mixin <dfn data-dfn-type="interface" id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
{
const GLenum READ_BUFFER = 0x0C02;
const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
Expand Down Expand Up @@ -882,7 +882,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
undefined bindVertexArray(WebGLVertexArrayObject? array);
};

interface mixin <dfn id="WebGL2RenderingContextOverloads">WebGL2RenderingContextOverloads</dfn>
interface mixin <dfn data-dfn-type="interface" id="WebGL2RenderingContextOverloads">WebGL2RenderingContextOverloads</dfn>
{
// WebGL1:
undefined bufferData(GLenum target, GLsizeiptr size, GLenum usage);
Expand Down Expand Up @@ -977,7 +977,7 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
};

[Exposed=(Window,Worker)]
interface <dfn id="WebGL2RenderingContext">WebGL2RenderingContext</dfn>
interface <dfn data-dfn-type="interface" id="WebGL2RenderingContext">WebGL2RenderingContext</dfn>
{
};
WebGL2RenderingContext includes WebGLRenderingContextBase;
Expand Down

0 comments on commit fec72ba

Please sign in to comment.