W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

Re: [whatwg] Challenging canvas.supportsContext

From: Simon Pieters <simonp@opera.com>
Date: Tue, 25 Jun 2013 22:28:08 +0200
To: "Dean Jackson" <dino@apple.com>
Message-ID: <op.wy84g6q1idj3kv@simons-macbook-pro.local>
Cc: Benoit Jacob <jacob.benoit.1@gmail.com>, WHATWG <whatwg@lists.whatwg.org>
On Tue, 25 Jun 2013 21:01:27 +0200, Dean Jackson <dino@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.


Simon Pieters
Opera Software
Received on Tuesday, 25 June 2013 20:26:30 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:00 UTC