On 5/7/14, 9:20 AM, Ehsan Akhgari wrote:
interface WebGL2RenderingContext : WebGLRenderingContext {
// new methods go here
};
partial interface HTMLCanvasElement {
(CanvasRenderingContext2D or
WebGLRenderingContext or
WebGL2RenderingContext) getContext(DOMString id, optional any
options = null);
A nit: this is not valid IDL, since WebGLRenderingContext and
WebGL2RenderingContext are not distinguishable.
The good news is that the return value can just be
(CanvasRenderingContext2D or WebGLRenderingContext) and still return
instances of WebGL2RenderingContext if it wants to, in the same way that
a method that claims to return Node can return instances of any node
subtype if it wants to.
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform