Posted by josh at August 4th, 2008

Whoa! Am I the only one who didn’t get the memo that suddenly Firefox has really impressive SVG support? Check out these demos and be amazed at what you didn’t think your browser (sans Flash) could do.

Is there any more point to the HTML <canvas> element?

Does anyone know if this notion of a “compound document” is standardized? Eg. where I can have an HTML page with an SVG snippit embedded, and I can manipulate it from JavaScript as one big DOM? I know this works in Firefox (as the above linked-to examples demonsrate), but will other browsers that add SVG support work the same way? If so, the standard HTML+CSS+JavaScript platform just got a *lot* more capable.

There is the capability for doing animation (as this demo illustrates) by using JavaScript’s setTimeout or setInterval to run some JavaScript code periodically that updates the DOM. This seems to work decently, though you have to do all the math yourself and the animation can be a little choppy (since it’s all JavaScript). It appears that SVG also defines animations that you can specify declaratively which seems like it would both let you express animations at a higher level (”set this element into motion based on a spline with these key points”) and would probably get you smoother results since it the animation would be implemented at the browser level instead of JavaScript. But Firefox doesn’t currently support any of the animation module.