[whatwg] Callback driven initialization of canvas

Ian Hickson ian at hixie.ch
Thu Apr 30 15:50:46 PDT 2009

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.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list