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

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

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 09 Apr 2012 12:22:28 +1000
Message-ID: <4F8247E4.8010403@mcc.id.au>
To: Kenneth Russell <kbr@google.com>
CC: Glenn Maynard <glenn@zewt.org>, Boris Zbarsky <bzbarsky@mit.edu>, public_webgl@khronos.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
Kenneth Russell:
> Sorry about that. It looks like I did drop that set of changes on the
> floor by accident. Let's resolve this issue now.
> Has there been a decision on the best path forward here? The
> requirements in the WebGL spec are relatively small; it must be
> possible to pass a user object to getContext("webgl", /* attrs */) and
> it must be possible to define the attributes and their types returned
> from getContextAttributes. Aside from that the existence of the
> WebGLContextAttributes interface is not important.

Another problem is that a callback interface can't be used as the return 
type of getContextAttributes().  (It seems Web IDL doesn't explicitly 
disallow this, but it should.)

Am I right in thinking that assigning to the properties of the object 
returned from getContextAttributes() shouldn't affect the context?  In 
that case, I think we can just change WebGLContextAttributes to a 
dictionary, and that lets us put the defaults on the dictionary too to 
avoid mentioning them in prose:

   dictionary WebGLContextAttributes {
     boolean alpha = true;
     boolean depth = true;
     boolean stencil = false;
     boolean antialias = true;
     boolean premultipliedAlpha = true;
     boolean preserveDrawingBuffer = false;

getContextAttributes() will then return a new JS object with those six 
properties set on it.
Received on Monday, 9 April 2012 02:23:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:06 UTC