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

Re: [Public WebGL] Can getSupportedExtensions return null?



On Thu, Apr 26, 2012 at 19:27, Kenneth Russell <kbr@google.com> wrote:
>> I'm not sure to remember what was the intent here, but I think adding
>> "Returns a zero-length sequence if the context's webgl context lost
>> flag is set." would be a good idea.
>> It would avoid for some apps to throw at context loss because of this
>> call where they are (logically) expecting an array.
>
> The intent here was what the IDL specified. The spec has been updated
> to add the "?" in section 5.14.14 "Detecting and enabling extensions".

But... if no extension is supported, getSupportedExtensions returns an
empty sequence isn't it?
The spec seems unclear about this.

Since a lost context does not support any extension, shouldn't it
return an empty array as well?
IMHO we should try to avoid nullables where possible.

I suggest replacing :

"
sequence<DOMString>? getSupportedExtensions()
Returns an array of all the supported extension strings. Any string in
this list, when passed to getExtension must return a valid object. Any
other string passed to getExtension must return null.
"

with :

"
sequence<DOMString> getSupportedExtensions()
Returns an array containing the names of all extensions supported by
the context, or a zero-length array if the context does not support
any.
Any name present in this array must not return null when passed to getExtension.
"

Thoughts?

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------