W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2009

[whatwg] Callback driven initialization of canvas

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 30 Apr 2009 22:50:46 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0904302245530.18851@hixie.dreamhostps.com>
On Tue, 21 Oct 2008, Fabien Meghazi wrote:
> 
> Undoubtedly, in the future, canvas will be used for good stuff but also 
> for nasty stuff. Of course, how we consider nasty stuff is a personal 
> feeling. I don't like ads. Especially flash ads. This is why I use 
> Firefox extension flash block (amongs other reasons) I'm sure in the 
> future we will see canvas ads poping everywhere, and here's my concern :
> 
> Will it be possible for the browsers to allow an extension such as 
> canvas block ?

Sure, that should be possible easily enough.


> My understanding is that it won't be possible (please correct me if I'm 
> wrong, I'm not an expert) as the initialization of a canvas context is 
> done as follow :
> 
> var canvas = document.getElementById('tutorial');
> if (canvas.getContext){
>   var ctx = canvas.getContext('2d');
>   // drawing code here
> } else {
>   // canvas-unsupported code here
> }

I would imagine that for blocking you would either want nothing to show at 
all or want the regular fallback to show, so it doesn't seem necessary to 
catch this case. There's no need to delay the painting, either, the 
browser can just cache it for later.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 30 April 2009 15:50:46 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:11 UTC