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

no edit summary
No edit summary
No edit summary
Line 15: Line 15:
[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.
[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. Do not use any prefix (like MOZ_ or EXT_). Prefixes are only wanted in the extension string (see below). Here like in other places where all WebGL extensions are listed, '''please preserve alphabetic order'''. On the line just before your interface declaration, make sure that you have <code>[NoInterfaceObject]</code>. The IDL that you add should look like this:


Do not use any prefix (like MOZ_ or EXT_). Prefixes are only wanted in the extension string (see below). Here like in other places where all WebGL extensions are listed, '''please preserve alphabetic order'''.
[NoInterfaceObject]
interface WebGLExtensionFooBar
{
  // maybe something here
};


Add an entry about your new interface to {{moz-central|dom/bindings/Bindings.conf}}. Check existing WebGLExtension* entries for examples. You should have something like:
Add an entry about your new interface to {{moz-central|dom/bindings/Bindings.conf}}. Check existing WebGLExtension* entries for examples. You should have something like:
Confirmed users
753

edits