What’s Great About Firefox Deer Park and How to Turn it Off

I tried out the alpha build of Firefox 1.1, codenamed Deer Park. It looks pretty nice. The big deal for me is that it has built-in SVG rendering. Built-in incomplete SVG rendering.
To be frank, I've been putting off writing this post because I don't want to come off sounding negative, and I'm not sure how to approach it. I just like Adobe SVG Viewer better.

Read on, it can only get better ...

I feel better for having said it, but I feel there's a lot of explanation that goes along with the statement. The Adobe SVG viewer is a more complete implementation of SVG, that's no secret. The Mozilla people have been very clear and very up front about this. Straight off the new features page:
Currently a subset of SVG 1.1 Full, missing functionality includes filters, declarative animation, and SVG defined fonts.
I understand their dilemma, they have a great implementation of some really cool features. They should get to show off that new technology. It's been around in different builds for a long time now, and letting people see it can get people excited about SVG. I'm not involved with the development effort, but I'm sure that there was a lot of discussion and thought that went in to deciding to release it. I also recognize that a whole lot of really hard work is still going into building this software. I don't want to minimize that hard work -I want to encourage it to continue.

As much as I appreciate all the work that goes in to building an excellent, standards-compliant, open source browser, I can't pretend that the modules that are missing don't matter.

The high-profile features that are missing from the Firefox 1.1 Deer Park Alpha implementation of SVG (in my amateur opinion) are filters, SMIL, and many parts of the text support. I consider these important because they're used in the SVG examples that got me interested in the technology. To avoid hawking my own tutorials, let's look at one of the ones that made me say, 'hey, I should try out SVG'. Kevin Lindsey has some nice examples that fit the bill. These are the kind of thing that made people start calling SVG a "Flash-killer." These are the kind of demos that developers need to see to encourage them to use SVG. These examples don't work in the Firefox implementation of SVG.

There are plenty of other nice examples of SVG that require the features in Firefox Deer Park. Deer Park enables a whole lot of things that simply couldn't be done using the plugin model. The thing is, many users that have SVG are already using ASV, so ASV is a platform that should be supported (when possible) for the near term. Most of the SVG out there is coded to work in ASV. That includes sites that use SVG for visualization or other tasks that aren't academic demonstrations of how SVG works. These tasks should continue to work, and with the Deer Park implementation of SVG, they won't. Inevitably the more implementations of SVG there are, the more quirks developers have to deal with. There are sites showing up already that handle SVG quirks and can render properly in Mozilla SVG, ASV (in Firefox or Internet Explorer), Opera and others.

Why Choose?

Here's the real crux of my problem: why should I miss out by using Firefox? I could install the same Adobe SVG Viewer plugin on Internet Explorer and continue working the way I have been. That would sound like a good solution since I've glossed over the benefits of the built-in SVG rendering. The major obvious benefit is that SVG can be embedded in an XHTML with other XML.

So why should I give up viewing compound documents just to see all the old ASV examples out there? The answer I came up with was that I shouldn't. There's an easy solution for my problem, here, after all that rambling, it finally is:

I installed the Adobe SVG Viewer 6.0 Beta on Firefox 1.1 DP Alpha. I used the same instructions as usual, the same workaround to move the two files (NPSVG6.dll and NPSVG6.zip) into the plugins directory as usual, but the plugins directory now defaults to "C:\Program Files\Deer Park Alpha 1\plugins" . The catch is that now I have to turn off the built-in SVG rendering in Firefox before the plugin will be given a chance to render the SVG. That setting can be changed by navigating to about:config (bookmark it, that page is handy). The setting is called svg.enabled. Change it to false by just double-clicking it. Now navigate to the ASV compatible page that you want to go to. If you already have it open, then just refresh the page (press F5).

I said that I want the best of both worlds though and now all I have are the pages built for ASV. If I want to view pages that have SVG mixed with XML/XHTML or take advantage of the quick rendering of the built-in rendering, what to do? Just go back and toggle svg.enabled again. Sounds too slow? I thought so too. The line that says "Filter" on the about:config page takes some text and uses it to trim the preferences shown, so type "svg" in that box and you can navigate to it faster.

Still too slow?

Okay, I wanted an always-on way to quickly switch. Having Internet Explorer open with the Adobe SVG Plugin installed was always an option, but I like Firefox better.

So I wrote a little extension. It's nothing but a little toolbar with a dropdown that toggles the setting of svg.enabled and displays its current state. I recommend it for people that want to develop SVG or people that want to make sure they can get the best view of as many SVG-enabled sites as possible.

Right now the extension works, but I haven't made it available for download yet. maybe in a couple hours if I don't fall asleep first.

0
Your rating: None

You've been linked on ajaxian.com - nice work! ;)

Thanks, it was an interesting project to me. I didn't realize how much interest there'd be elsewhere. I'm going to have to get back to it with some little improvements later...

[...] With a little helpful prodding, I’ve just finally updated the version info for my SVG switcher extension. Essentially all it does is toggle the native SVG rendering in Firefox on and off by setting the svg.enabled to true or false. You can read more about my motivation for this in my previous post, and how to install and use it here. [...]

An alternative would be useful. After visiting several mapping sites, I have noticed that none of them use native SVG rendering, but rather the Adobe plugin. Would it not also be a useful utility to be able to recast tags for the plugin to instead? It would open up a world for people without a plugin (sometimes because of their platform.)

Hi Bob,
The problem, if I get what you mean, isn't usually the tags. The problem is more often in details like telling the web browser the right content type when the document is served and making sure the SVG document is valid. A valid SVG document is one that is well-formed and meets the requirements of the SVG standard.

Unfortunately, most of the problems this raises can't be fixed with a Firefox extension. Some could be fixed by making Firefox more lenient, but that opens up another whole can of worms. Since Firefox isn't going to bend and parse all the documents that were written for the Adobe plugin (instead of being written to the SVG standard), I find it's helpful for a user to be able to switch their viewer without switching web browsers.

What about a greasemonkey script that fixes these incongruities?

I doubt it - at least for most problems. If the document's not valid then there's no DOM. With no DOM I don't think there's even anything the greasemonkey script can see.