[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Should texSubImage2D accept null like texImage2D does?



On Sat, Mar 10, 2012 at 10:48 PM, Kenneth Russell <kbr@google.com> wrote:
Tim, do you remember this? It looks like an arbitrary method
will be called according to the Web IDL spec. Perhaps we could enforce
that INVALID_VALUE is passed in these cases since all of the overloads
should have the same behavior. WebKit already does this for what it's
worth.

An arbitrary method won't be called. Calling eg. texSubImage2D(..., null) will throw TypeError without calling any method, because no overload resolves to it. That's correct behavior; it's the same result as passing any other invalid parameter, such as texSubImage2D(..., window). http://dev.w3.org/2006/webapi/WebIDL/#call

This is probably not happening in practice right now, because the spec doesn't use nullable types correctly. Implementors have to guess which arguments are supposed to be nullable. texImage2D(ArrayBufferView) needs to be nullable, and lots of other calls need nullable arguments as well (eg. bindTexture). The other texImage2D overloads, and all texSubImage2D overloads, should not have a nullable argument.

--
Glenn Maynard