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

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

From: Kenneth Russell <kbr@google.com>
Date: Thu, 26 Apr 2012 18:04:48 -0700
Message-ID: <CAMYvS2cfOu0jy_n_fuHWvLwp+jQqqbOBktmDYeVfAd6ZWp1t6g@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
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>
On Sun, Apr 8, 2012 at 7:22 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> 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.

Sorry for the delay replying.

Thanks everybody for the analysis. It sounds like making
WebGLContextAttributes a dictionary is the right thing to do, since it
addresses the issue of making the entries optional, and also fixes
problems with the return value of getContextAttributes. WebGL spec and
IDL have been updated. Please post on public_webgl if you see problems
with these edits.

-Ken
Received on Friday, 27 April 2012 01:05:17 UTC

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