[Public WebGL] (summarizing) Canvas.getContext error handling

Cedric Vivier [email protected]
Sun May 1 22:54:09 PDT 2011


On Mon, May 2, 2011 at 11:06, Glenn Maynard <[email protected]> wrote:
> On Sun, May 1, 2011 at 11:40 PM, Cedric Vivier <[email protected]> wrote:
>> "6. Return a new object for contextId or null if the context could not
>> be created, as defined by the specification given for contextId's
>> entry in the WHATWG Wiki CanvasContexts page."
>
> It needs a bit more than that. (...)
> That's not hard, by any means--someone just needs to convince upstream
> that a change is needed.

Yes, just a bit more work on this but nothing earth-shattering indeed.
Both options need a similar change to Canvas spec wrt context creation
steps anyways, I just submitted a more serious proposal :

http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031415.html


> No, upstream was opposed to the idea of getContext reporting the
> reason for the error at all.  This applies to either approach.  He
> argued (briefly--I didn't press the issue, so I don't know how
> strongly he feels about this) that the reason for the context failing
> shouldn't even be exposed to scripts.

This does not apply to option #1 approach, the application only gets
notified the context is not currently available _as usual_ (null), the
application does not know the reason.

Otherwise I completely agree with this, in fact this is the main
reason why I'm strongly leaning towards option #1.
I also believe the reason for context creation failure should not be
exposed to scripts, except for debugging purposes only, which was the
(long forgotten?) rationale for webglcontextcreationerror in the first
place iirc (otherwise we would also have statusCode rather than
statusMessage only).

This implies a context-specific (new contexts can have completely
different reporting needs) opt-in (rules exceptions out) mechanism.

As it is context-specific it is by definition completely independent
from the Canvas spec, it is something that happens within step 6 when
Canvas spec gives control to the context spec for the actual context
object creation.
And that's exactly what we got with 1.0-ratified webglcontextcreationerror.


Regards,

-----------------------------------------------------------
You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------




More information about the public_webgl mailing list