Firefox SVG Support
Saturday, July 1st, 2006I made a quick pass through many of the SVG files on my site this morning. Last week I focused on Opera 9 as the target SVG user agent. Today, I focused on Firefox 1.5. I did get a nice jump start from last weeks fixes, but so far, I’d say Opera is more pleasant to work with than Firefox.
A number of my samples use SMIL and, unfortunately, there appears to be no SMIL support in Firefox. I could resort to script to emulate SMIL; however, the irony is that I created many of those examples to explicitly avoid the use of script.
Another problem was with the use of em values in the dy attribute of <text> and <tspan> elements. Ems are useful in that they allow me to define leading independently of font size. Without them, I have to hard code the font-size. This is a bit annoying in cases where I want on-the-fly font-size changes (maybe for accessibility reasons, for example). I have to resort to DOM magic to update the attributes to match the new size and heaven forbid if I was using values like 1.25em.
I ran into an issue where large rectangles stopped firing mousemove events. ASV had a nice “feature” that let you define ridiculously large rectangles to get mouse events outside the browser’s window. I adopted this practice in a number of places, but Firefox didn’t like the values I was using. Fortunately, I was able to reduce the rectangle size and I started getting events again.
I haven’t done any performance comparisons, but it feels like ASV is fastest of the three in many cases. Firefox comes in second and Opera is the slowest. However, a few fairly CPU-intensive samples were noticably faster in Firefox which was good to see.
It’s really encouraging to see SVG expanding into new spaces. Lets just hope this support will continue to grow and to improve in these browsers and not go the way of ASV.