[whatwg] SVG extensions to <canvas>

Charles Pritchard chuck at jumis.com
Mon May 4 13:51:23 PDT 2009


Oliver writes:
>> I believe drawImage should be left as it currently is (basically taking
>> objects that are intrinsically bitmap-ish), and if we were to add an
>> ability
>> to draw an svg element into the canvas it should really be an simple
>> drawElement(Element) method instead, after all, why restrict it it just
>> to
>> SVG elements?

Giovanni writes:
> <svg> has an intrinsic size (like <video>,<img>, and
> <embed>/<object>), the other have not.

Adding onto Giovanni's statement:

SVG is a graphics format -- there are specifications as to how each
element should render (how it should look). HTML has no such
specifications.

While you can roll your own drawElement(Element), it will give you
unstable output. Drawing an SVG should give you stable output across all
browsers (supporting SVG).

It's possible that a CSS Box Element could be drawable, per standards. I
think that's something to be inherited from SVG-land, not an item for the
Canvas specs. I'm sure SVG will gradually borrow more from the CSS Level 3
model as it matures. Meanwhile, roll your own.

-Charles



More information about the whatwg mailing list