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

Re: [Public WebGL] Proposed change to WebGL Event definition



I'm not concerned about this confusion. Status codes are enums, types are strings. The status codes for lost and restored context allow you to have a single handler with a simple switch for handling the codes.

Sent from my iPad

On Aug 25, 2010, at 7:02 PM, Cedric Vivier <cedricv@neonux.com> wrote:

On Sun, Aug 22, 2010 at 23:05, Chris Marrin <cmarrin@apple.com> wrote:
In DOM events the type is always the DOMString of the event type (e.g., "webglcontextlost"), so you do get what you're looking for, right?
(...)
There is a separate status code. You don't see the 'type' property in the WebGLContextEvent is because it's in the parent Event interface.


Oopsie, indeed.
Then shouldn't we dump CONTEXT_LOST/CONTEXT_RESTORED status codes ? They are redundant and confusing, statusCode can be 0/undefined for the corresponding events for now.
Their mere presence guarantees people will mistakenly use them as marker of event type and it will break code whenever we may introduce "real" status codes additions to "webglcontextlost" or "webglcontextrestored" events (eg. full vs partial loss for instance).

Regards,