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, 02 Apr 2012 09:12:02 +1000
Message-ID: <4F78E0C2.5010903@mcc.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: Glenn Maynard <glenn@zewt.org>, public_webgl@khronos.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
Boris Zbarsky:
> I wonder whether it would be worthwhile to extend overload resolution in
> WebIDL to handle this case by introducing the ability to declare
> overloads where an argument is a constant and treating all constants as
> distinguishable.  So then the IDL for getContext could look like this:
>    getContext(DOMString "webgl", WebGLContextAttributes attrs);
> or something... The syntax could obviously use improving.

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.  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?
Received on Sunday, 1 April 2012 23:12:44 UTC

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