[Public WebGL] Should WebGLContextAttributes be a callback interface?
Sun Apr 1 16:29:35 PDT 2012
On Sun, Apr 1, 2012 at 6:12 PM, Cameron McCormack <[email protected]> wrote:
> This is an interesting idea, but I wonder if it is really a pattern we
> want to encourage by supporting it directly in the IDL.
I think this pattern should be discouraged, FWIW.
Is it too troublesome not to handle it in prose, by leaving getContext
> defined as
> object? getContext(DOMString contextId, any... args);
> in the HTML spec, and then having some prose hooks for what to do for
> particular types that the WebGL spec could refer to?
The language I suggested earlier was:
That's based on the conversation we had, combined with how things like
Event constructors work, with a separate *Init dictionary type for the
interface. The separate *Init type isn't strictly needed here (unlike
events, every attribute in WebGLContextAttributes would also be in
WebGLContextAttributesInit), but it also means WebGLContextAttributes
doesn't need to have all of its attributes nullable.
Think that needs hooks to make the language simpler? Since this is sort of
a one-off thing (one per context type, and there are no signs that there'll
ever be many others), it may not be worth it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the public_webgl