Re: [Public WebGL] Should WebGLContextAttributes be a callback interface?

On Sun, Apr 1, 2012 at 6:12 PM, Cameron McCormack <cam@mcc.id.au> 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:
https://www.khronos.org/webgl/public-mailing-list/archives/1112/msg00037.html

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.

-- 
Glenn Maynard

Received on Sunday, 1 April 2012 23:30:03 UTC