Platform/GFX/WebGL/Contribute/Extensions: Difference between revisions

Line 5: Line 5:
==General Approach==
==General Approach==


For the purposes of this page, we will pretend there is a WebGL extension named <code>WEBGL_foo_bar</code> that we're trying to implement.
For the purposes of this page, we will pretend there is a WebGL extension named <code>WEBGL_foo_bar</code> that we're trying to implement. This extension will be listed in the [http://www.khronos.org/registry/webgl/extensions/ WebGL Extension Registry], which will link to the specification of this extension. [http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/ Here's an example] of an extension specification.


===Adding the Web IDL===
===Adding the Web IDL===
Line 13: Line 13:
* {{moz-central|dom/bindings/Bindings.conf}}
* {{moz-central|dom/bindings/Bindings.conf}}


WebIDL stands for "Web interface definition language". It's how Web APIs are specified. The extension spec should provide a snippet of WebIDL. In most cases, it can be used as-is or with very little modification in Mozilla's IDL system.
[http://www.w3.org/TR/WebIDL/ WebIDL] stands for "Web interface definition language". It's how Web APIs are specified. The extension spec should provide a snippet of WebIDL. In most cases, it can be used as-is or with very little modification in Mozilla's IDL system.


Add the Web IDL from the extension spec to {{moz-central|dom/webidl/WebGLRenderingContext.webidl}}. For the interface name, instead of the one given in the extension spec, try to choose a name more in line with existing interface names here. For example, for WEBGL_foo_bar, you could choose WebGLExtensionFooBar.
Add the Web IDL from the extension spec to {{moz-central|dom/webidl/WebGLRenderingContext.webidl}}. For the interface name, instead of the one given in the extension spec, try to choose a name more in line with existing interface names here. For example, for WEBGL_foo_bar, you could choose WebGLExtensionFooBar.
Line 88: Line 88:


===Adding Tests===
===Adding Tests===
Unfortunately, odds are fairly high that we don't have a test case for this particular extension! It would be very useful to write one, and even more useful to write one that can be added to the conformance test suite.  
Unfortunately, odds are fairly high that we don't have a test case for this particular extension! It would be very useful to write one, and even more useful to write one that can be added to the conformance test suite.


==Other Remarks==
==Other Remarks==
Confirmed users
753

edits