To view parent comment, click here.
To read all comments associated with this story, please click here.
Because Canvas gives you per-pixel control and fast animation that isn't possible with SVG. Canvas display is also limited to the canvas tag it's within whereas SVG can be placed anywhere.
Emulators have been written in Canvas/JS. You can't do that in SVG at all.
Canvas is for using for non-accessibility related issues. If I'm making a game in Canvas/JS instead of Flash; why should I care about accessibility when a blind person is not going to be able to see it anyway - regardless if it was Flash or Canvas.
A 3D rendering of a product is no more or less accessible as a Canvas / PNG, Flash or Java object as long as they have relevant ALT attributes &c.
SVG is for preserving document fidelity in the future as screen resolutions increase. Canvas is for making pretty, animated things.
I kid of get the performance argument for canvas, although in this case I don't get the point of JS, java being superior from my point of view. It should be used where it needs to be used, but not where SVG can replace it. SVG can do pretty animations too and objects are identifiable and usable from javascript. You also have events like click events and stuff in SVG. You can use the optimizeSpeed attribute and get per-pixel precision. You can also use bitmaps in SVG. It can do much more than static scalable pictures.
SVG is an event scriptable 2D scene graph, and it can be parsed and rendered (with pixel precision if need be) as quickly as any other 2D scene graph, and faster than a 3D scene graph because 2D doesn't have to consider as many values. The problem so far has been that implementations suck.
In no way, shape, or form is this an advantage.
Not only that, but an SVG element can be made to model the Canvas behavior you described simply by setting overflow:hidden, which is even the DEFAULT if I'm not mistaken. On the other hand, it is not possible to get Canvas to model the behavior an SVG element has when set to overflow: visible|auto.
For the life of me, I cannot understand why the browser hasn't evolved into a generic scene graph renderer at this point.






Member since:
2006-11-17
I didn't do it indeed, but I've done SVG and I don't get canvas. Elements in canvas are not identifiable. It's bad in many aspects in my opinion, starting from lack of accessiblity. A lot of people using the web are blind, or have disabilities that prevent them to use the web like the web master think they should use it. SVG is well formed XML and therefore is DOMable. That makes it way better suited for the web in my opinion. If they make canvas because it is easier to use, why don't they put energy in making tools to generate SVG instead? Cairo does it. Why can't they convert canvas to SVG?
By the way, the same is true for flash. They should convert it to SVG and be done with their opaque format.
Edited 2008-09-23 13:18 UTC