W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

A read on a WebGL overload

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Tue, 29 Sep 2015 21:17:10 +0000
To: Boris Zbarsky <notifications@github.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, Justin Rogers <justrog@microsoft.com>
Message-ID: <BY2PR03MB393F0A22CEC4219DDA68003F84E0@BY2PR03MB393.namprd03.prod.outlook.com>
Some folks on the Edge team are debating how to handle this case from WebGL when passed the literal undefined as param 2:


    void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
    void bufferData(GLenum target, BufferDataSource? data, GLenum usage);


typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
typedef long long GLsizeiptr



>From my read on WebIDL, the second params in each of these overloads does not pass the distinguishability test:



1.       Numeric type + buffer source types are not distinguishable

2.       Each member of the BufferDataSource union type is not distinguishable

3.       Req. 3 is not applicable.



Does this constitute a violation of WebIDL? Or did I read this wrong? If I re-work the definition as:

    void bufferData(GLenum target, (GLsizeiptr or BufferDataSource?) dataOrSize, GLenum usage);

then I think it becomes clear according to the conversion rules for union types, to pass null to the implementation.
Received on Tuesday, 29 September 2015 21:17:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 29 September 2015 21:17:44 UTC