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

[whatwg] Request: Canvas Tag CSS

From: Mathieu HENRI <p01@opera.com>
Date: Tue, 08 Apr 2008 10:49:43 +0200
Message-ID: <47FB31A7.60202@opera.com>
Greg Houston wrote:
> I didn't know SVG had CSS support. That's great, but I fail to see your point.
> 
> A table serves a different purpose than a div, yet both are styled in the CSS.
> 
> A paragraph serves a different purpose than an image, yet both are
> styled in the CSS.
> 
> A blockquote serves a different purpose than a submit button, yet both
> are styled in the CSS.
> 
> SVG and Canvas serve different purposes, yet the both have style, and
> both should be supported by CSS.

Except that there is a slight difference between a declarative element 
and a programmatic one.

SVG being declarative, it has an actual DOM tree with elements and 
attributes that can be affected using CSS.

The Canvas element itself can be styled with CSS ( borders, size, 
outlines, background, ... ) but what is done in the CanvasContext does 
not end up in the DOM tree and therefore their styling can not be 
affected using CSS.


-- 
Mathieu 'p01' HENRI
JavaScript developer, Opera Software ASA
Received on Tuesday, 8 April 2008 01:49:43 UTC

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