W3C home > Mailing lists > Public > public-html@w3.org > September 2012

RE: [Canvas] proposal for supportsContext

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Tue, 11 Sep 2012 16:12:25 +0000
To: Robin Berjon <robin@w3.org>, Dean Jackson <dino@apple.com>
CC: "public-html@w3.org" <public-html@w3.org>
Message-ID: <9768D477C67135458BF978A45BCF9B383846741B@TK5EX14MBXW602.wingroup.windeploy.ntdev.microsoft.com>
On the other hand, you could change the way that the 3d context is obtained from the canvas element, to better allow feature detection...

if (canvas.context3d) {
   ...
}

??

> -----Original Message-----
> From: Robin Berjon [mailto:robin@w3.org]
> Sent: Tuesday, September 11, 2012 1:41 AM
> To: Dean Jackson
> Cc: public-html@w3.org
> Subject: Re: [Canvas] proposal for supportsContext
> 
> Hi Dean,
> 
> On 10/09/2012 20:11 , Dean Jackson wrote:
> > I propose adding a new method to HTMLCanvasElement:
> >
> > interface HTMLCanvasElement : HTMLElement {
> >    boolean supportsContext(DOMString contextId, any... arguments);
> > };
> >
> > supportsContext takes the same parameters as getContext, and simply
> returns
> > true if the corresponding call to getContext would have returned a valid
> > context, false otherwise.
> 
> I like it. My only concern is about why this would work when
> hasFeature() failed so miserably. I guess that it covers a sufficiently
> limited set that it will be done right.
> 
> --
> Robin Berjon - http://berjon.com/ - @robinberjon
> 
Received on Tuesday, 11 September 2012 16:13:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:34 UTC