[whatwg] Challenging canvas.supportsContext

Simon Pieters simonp at opera.com
Tue Jun 25 13:28:08 PDT 2013


On Tue, 25 Jun 2013 21:01:27 +0200, Dean Jackson <dino at apple.com> wrote:

> Showing or hiding interface objects is not something I want to do.

It's possible that I missed it, but, why not? There is precedent for doing  
so. For instance, in Opera 11, the WebSocket constructor was absent unless  
WebSockets were enabled in opera:config. This allowed feature detection  
like the following to work:

var supports_websockets = "WebSocket" in window;

Also, the HTML spec actually requires it:

[[
When support for a feature is disabled (e.g. as an emergency measure to  
mitigate a security problem, or to aid in development, or for performance  
reasons), user agents must act as if they had no support for the feature  
whatsoever, and as if the feature was not mentioned in this specification.  
For example, if a particular feature is accessed via an attribute in a Web  
IDL interface, the attribute itself would be omitted from the objects that  
implement that interface — leaving the attribute on the object but making  
it return null or throw an exception is insufficient.
]]

http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#extensibility

-- 
Simon Pieters
Opera Software



More information about the whatwg mailing list