WebGL2RenderingContext should not extend WebGLRenderingContext
document.createElement("canvas").getContext("webgl2") instanceof WebGLRenderingContext
is false, so I think these contexts should not extend each other.
One way to model this (the approach used by TypeScript) would be to define a non-existent common parent interface that includes all the common properties and their types.
non-existent common parent interface
I was thinking something along those lines but I'm not sure if it should be an @interface, an @abstract @constructor (like BaseRenderingContext is for CanvasRenderingContext) or maybe a @record (given the note in https://github.com/google/closure-compiler/blob/master/externs/browser/html5.js#L475 ).
My goal is to use WebGL 2 from GWT through Elemental 2 which uses externs from this repo (https://github.com/google/elemental2/pull/181)