On Sep 3, 2010, at 10:08 PM, Cedric Vivier wrote:
I think that's another status code. Perhaps reasons for failure are:
- WebGL is not implemented (the event will never fire)
- WebGL is disabled by the browser
- WebGL is disabled by request of the user
- Hardware is insufficient for running WebGL content
- System is unable to run WebGL content because of other system constraints.
Maybe it is a bad idea to have status codes. There could be many more reasons for not being able to use WebGL content. So maybe we should do as Ken suggests and only have a status message. That way the user agent can put any necessary recommendations into the string. The browsers would have L11N issues, but that is probably manageable.
The unfortunate thing is that, if you don't have WebGL support at all, this event will never fire. You will simply get a null return from getContext(). You' have to set up a timer and if it fires without any event being generated you know you don't have WebGL. That's a hack.
I think the right way to handle that is to add a media query for WebGL. We've made a proposal to add media queries for CSS animations, transitions, and transforms. These are all supported in WebKit today. It would be easy to add one for 'webgl'. You can run the query from JS and know you don't have WebGL without having to call getContext(). But the really nice thing about media queries is that you can use them in CSS style sheets. If WebGL is missing you can style the page differently for, for instance, not take up the space for the WebGL canvas.
So the proposal is to get rid of statusCode and add a media query for 'webgl'. I will talk to dino, who is pushing the media query extensions spec, about this as well.