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

WebGL IDL for uniform1fv is not valid WebIDL

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 02 Apr 2012 10:48:32 -0400
Message-ID: <4F79BC40.6010608@mit.edu>
To: public webgl <public_webgl@khronos.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
The IDL in question is:

     void uniform1fv(WebGLUniformLocation? location, Float32Array v);
     void uniform1fv(WebGLUniformLocation? location, float[] v);

Unfortunately if you look at the table at 
http://dev.w3.org/2006/webapi/WebIDL/#dfn-distinguishable you see that 
T[] and an interface type (which is what Float32Array is) are only 
distinguishable if the interface type doesn't support indexed 
properties.  Which Float32Array does, of course.  So this IDL fails this 
requirement from the section linked above:

   If there is more than one entry in an effective overload set that has
   a given type list length, then for those entries there MUST be an
   index i such that for each pair of entries the types at index i are
   distinguishable.

Cameron, I'm not sure why exactly interface types with indexed 
properties are not distinguishable from IDL arrays.  For non-callback 
interfaces, it seems like the UA could tell them apart and we could 
define that the interface version is called if the right interface is 
passed in, else the array version is called.

But failing changes to WebIDL, the IDL here would need to change somehow.

-Boris
Received on Monday, 2 April 2012 14:49:02 UTC

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