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

Re: [Public WebGL] Re: [whatwg] Canvas.getContext error handling

On Wed, Apr 20, 2011 at 10:20, Mark Callow <callow_mark@hicorp.co.jp> wrote:
> On 19/04/2011 04:06, Glenn Maynard wrote:
>> Following up from whatwg:
>> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-April/031192.html.
>> To recap, step 6 of getContext ("Return a new object for contextId"),
>> which is where WebGL takes over, was never intended to return null.
>> null isn't a "new object", it's no object.
> What happens if the context type passed to getContext is not recognized
> by the browser, e.g., when WebGL is not supported by the browser?

Null is returned, as specified in the Canvas spec.

> If we go this route, a status message in webglcontextlost is
> insufficient. Applications that wish to handle webglcontextlost will not
> want to be parsing strings, especially localized strings, to determine
> if the browser is refusing to create a context, so there is no
> possibility of restoration, or if it is a normal context lost event.
> Some kind of error code will be needed.

Yes, I believe adding an isRestorable boolean to the webglcontextlost
event would help to differentiate between a permanent or transient

statusMessage should be used for display only and should never have to
be parsed.
To make sure it does not get abused *and* to let browsers give better
diagnostic to users, we might even want to get rid of it, if the
browser actually has useful failure information to provide, it could
expose it in a more useful/consistent way to the user directly.

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