[whatwg] Why Canvas?

Andrew Fedoniouk news at terrainformatica.com
Tue Jul 31 17:44:06 PDT 2007


----- Original Message ----- 
From: "WeBMartians" <webmartians at verizon.net>
To: <whatwg at whatwg.org>
Sent: Tuesday, July 31, 2007 4:34 PM
Subject: [whatwg] Why Canvas?


> With <canvas> a relatively stable (and implemented, actually) tag, this 
> may be a doubtful question. However, I can't think of any answer, so here 
> goes...
>
> Why <canvas>?
>
> Why not allow the graphics primitives to operate on any element (not just 
> <canvas>) that has a height and width that may be expressed in picture 
> elements... ...even window.screen with its .availHeight, .availWidth, 
> .height, and .width (yeah, I know, the Screen object is actually a 
> JavaScript object, not an HTML DOM object)?
>

I think this discussion
http://lists.w3.org/Archives/Public/public-html/2007Apr/0355.html
is related to the subject.

Image (object) has pixel buffer so it is pretty logical to add
Graphics interface to it. The only feature left is 
style.setBackgroundImage() method:

var el = document.getElement....;
el.style.setBackgroundImage( el );

In this case it would be possible to render graphics on any element.

And if we will add 'foreground-image' CSS attribute & friends (similar to
backround-*** attributes) then you would have an option to choose where
to draw it - on background or on foreground layer (on top of the content)

Andrew Fedoniouk.
http://terrainformatica.com







More information about the whatwg mailing list