W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

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

From: Glenn Maynard <glenn@zewt.org>
Date: Sun, 1 Apr 2012 18:29:35 -0500
Message-ID: <CABirCh8nnzhnOL-DWyGXjEgk3OGJw0k6c1WuV8tpH1YtyFQgDg@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, public_webgl@khronos.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC