W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2012

Re: [whatwg] [canvas] Proposal for supportsContext

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 23 Oct 2012 02:14:12 +0000 (UTC)
To: Glenn Maynard <glenn@zewt.org>
Message-ID: <Pine.LNX.4.64.1210230208450.2471@ps20323.dreamhostps.com>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>
On Mon, 22 Oct 2012, Glenn Maynard wrote:
> On Mon, Oct 22, 2012 at 6:36 PM, Ian Hickson <ian@hixie.ch> wrote:
> > > 
> > > If you really want to protect users from the behavior of pages, 
> > > you'd really need to make creating the context cheap.  For example, 
> > > don't switch to a high-power GPU until the page actually draws 
> > > something, and--since many pages use both Canvas and WebGL for 
> > > one-shot rendering--be sure to switch back to the low-power GPU 
> > > after some idle time.
> >
> > That does seem like a somewhat better implementation strategy, if 
> > viable, but doesn't preclude the supportsContext() feature.
> 
> It doesn't preclude it, but it doesn't seem to fix the problem, either:
> 
>| Yes, it could. But we don't control Modernizr or any other scripts 
>| people might use. I'd rather provide something at the browser-level to 
>| protect from bad practice than expect every page to behave nicely.
> 
> This (from Dean, the OP) seems to be an argument *against* 
> supportsContext, since supportsContext is precisely "expecting every 
> page to behave nicely".  Something-at-the-browser-level is what I 
> described above (in reply).
> 
> And if the nicer above fix is implementable, supportsContext seems 
> unnecessary.

Well, it's always going to be cheaper to return a boolean than an object, 
so if that _does_ work, then that's better. I agree that it's possible 
that it won't and that we'll have to either drop the feature or live with 
it even though it's not used much.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 23 October 2012 02:14:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT