You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Mozilla SVG Project Frequently Asked Questions

This FAQ was originally drawn up after searching through the newsgroup mozilla.dev.tech.svg and the discussion forums at forums.mozillazine.org to see what sort of questions were being asked about SVG in Mozilla. If you have a question you think should be added to this page please let us know.

Does Mozilla support SVG?

Yes. The new version of Mozilla Firefox, version 1.5, has native support for a subset of SVG 1.1 Full. If you are still using an old 1.0.x version of Mozilla Firefox then download the new version from mozilla.com and try it out.

What is the status of the SVG implementation?

We currently maintain two documents to help answer this question: a status page for SVG in Firefox 1.5 and a status page for SVG in the development trunk.

Why does Mozilla show source code/gibberish instead of SVG?

There are two possible reasons for this: a simple mistake in the SVG file, or a misconfigured server.

If there's a grey area at the top of the source with the text "This XML file does not appear to have any style information associated with it" then the problem is with the SVG file. To be valid the root <svg> tag in SVG files must have at least the following two "namespace bindings".

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">

Actually the second binding isn't always required, but unless you understand namespaces, we'd strongly recommend you include it. For more information see this link.

If source code is displayed without a gray area at the top, or if you just see gibberish, then the problem is server misconfiguration. When servers send user agents an SVG file they must tell the user agent that the file has the MIME type "image/svg+xml", and if the SVG file is stored gzipped they must tell the browser that too. Mozilla is strict about this, and no, it's not a bug. Failing to respect the MIME types servers send is incorrect and has been a source of security holes in other browsers. Mozilla will not be changing this behaviour. For more information on server configuration for SVG see this link.

Why does Mozilla show an "XML Parsing Error" message instead of SVG?

This is an XML debugging message to help XML authors correct errors in their XML documents. Mozilla will show this message when there's an XML well formedness error in the file it tried to load. (It doesn't mean there's an error in Mozilla.) There are many different XML errors, but the most common one in SVG files is "XML Parsing Error: prefix not bound to a namespace". This is (almost certainly) because the 'xmlns:xlink' attribute has been used in the file without including the following two namespace bindings on the root <svg> tag.

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">

Make sure all your SVG files have these bindings. For more information see this link.

Why am I asked to choose a program to open SVG files?

When you try to load SVG files from some websites you may get a dialogue asking you "What should Firefox do with this file?". This is either because your browser doesn't support SVG (you must have Mozilla Firefox 1.5 or newer), or because the webpage/server isn't correctly telling Mozilla that the file contains SVG. For example, webpages that embed SVG using the <object> or <embed> tags must have a 'type' attribute assigned with the correct SVG MIME type of "image/svg+xml". If the MIME type specified is wrong (for example image/svg-xml) Mozilla won't recognise it. If that isn't the problem, then it may be that the server hosting the website is misconfigured. For information on configuring servers for SVG see this link.

Why am I asked to install a plug-in to view SVG files?

This is probably because there is an <embed> or <object> tag in the HTML page and its 'type' attribute is set to the wrong MIME type. The SVG MIME type is image/svg+xml (not image/svg-xml or anything else for that matter). Correct this mistake or ask the document maintainer to correct it.

How should I report bugs in Mozilla SVG?

If you discover any problems with our SVG implementation that you think we should know about then we'd like to hear from you. To help us make the best use of our time, please first search in the SVG component of our bug database to check that the issue hasn't already been reported. If you can't find a matching bug please file a new SVG bug report, preferably attaching a (very small!) SVG file that demonstrates the bug. If you have any problems with the bug database feel free to contact us.

Can I use a plugin for SVG instead of Mozilla's native support?

Individuals can choose to use a plugin to view SVG in Mozilla on their own computers, but there is no way for SVG content authors to make Mozilla use a plugin when people view the SVG files on their website. The native SVG support must be turned off before Mozilla will look to see if there's an SVG plugin installed. This is done by toggling a hidden user configuration preference (pref). To access the pref type about:config into the URL bar, then type svg.enabled into the Filter field. When you double click on the pref you will see its value change to and from true/false, turning the native support on/off.

How does Mozilla's SVG implementation compare to Adobe's?

Mozilla's native implementation is less complete than Adobe SVG Viewer's in general. There are major features such as filters and SMIL based animation that have still to be implemented in Mozilla. However, Mozilla's implementation already supports some things that Adobe's lacks, particularly parts of the XML and SVG DOMs. For example we support SVG exceptions and SVGTransform objects.

How do you install Adobe's SVG Viewer in Mozilla?

The SVG project is about Mozilla's native implementation of SVG, not Adobe/Corel/whoever's plug-in. However, we might as well answer this question to save you searching for this information elsewhere. See these install instructions on mozdev.org. It's also useful to know that you can check whether Mozilla has recognised your plug-ins by typing 'about:plugins' into your address bar (linking to that doesn't work for security reasons).

Does Mozilla work with Corel's SVG plug-in?

There are reports that it does, but that it's slower than the Adobe plug-in. See this document for information on how to install it.

Can you have both native SVG support and an SVG plug-in installed?

Yes. If the plug-in works with the equivalent non-SVG version of Mozilla, then it should also work in the SVG enabled version. To be able to use it, you must make sure the svg.enabled pref is set to false. This will disable the native SVG support.

Does the <embed> tag support SVG documents?

Yes. As of 2004-11-11, builds with native SVG support will use the native support to render SVG documents that are embeded by reference into an HTML document using the <embed> tag. Note that this capability was added to support legacy content. The <object> tag should be used in preference to the <embed> tag in new content whenever possible.

The first milestone builds that will have this support will be SVG enabled builds of Firefox 1.5.

What can I do to help the SVG project?

Okay so maybe this isn't such a frequently asked question, but if it was, just think how much further on with our SVG implementation we could be! We're always looking for help from anyone willing to lend a hand. If you're a C++ programmer interested in working on the SVG implementation, please contact us and we'll be happy to help you get involved. Alternatively, if you're an SVG user you can help by testing the SVG enabled nightlies and filing bugs with minimal testcases whenever you encounter a problem. If you can't do either of these things you should still feel free to ask us friendly questions and give us constructive feedback.

Who's currently working on what?

Other than reviewing patches and fixing the occassional bug, Alex is currently taking a break from active SVG development to concentrate on 'real work' and cool stuff like XTF and JSSh. Tim is working on implementing <filter> and working on items that need to be done before turning on SVG by default. After recently implementing gradients, Scooter is working on fixing some issues that remain outstanding and fixing <switch>. Jonathan is working on various bugs, especially those that need to be fixed before SVG can be enabled in the official builds. David continues to create SVG enabled nightlies and answer build related questions as he has done for some time. Finally, occasional fixes are provided by other Mozilla hackers.

How can I get in contact with you?

The best way to get in contact with us is to join the #svg channel on mozilla.org's IRC server. This is where most of us hang out to discuss issues relating to the SVG implementation. If you don't have an IRC client then install chatzilla into Mozilla/Mozilla Firefox (note it may already be built in). Clicking on the link above should then take you straight there. If you'd prefer to contact us by email you can send an email to our newsgroup mozilla.dev.tech.svg which is archived here. Alternatively you can email any of us directly of course (see the preceeding question for our email addresses).


Jonathan Watt