与SVG、Mozilla有关的常见问题 - SVG 编辑

注意:这个页面可能有点过时了。

SVG的编译器正处于哪种状态?

我们目前维护了两个文档用来帮助回答这个问题:status page for SVG in Firefox 1.5+ 和 a status page for SVG in the development trunk.

为什么Mozilla会显示源代码或乱码,而不是显示SVG图像?

这有两种可能的原因:SVG文件中有一个小错误,或者服务器配置不对。

如果源码的顶部有灰色区域,灰色区域里有文字“This XML file does not appear to have any style information associated with it(该XML文件找不到任何与它关联的样式信息)”,则问题是与SVG关。作为一个合未能的根SVG文件中的<svg>标签,必须至少跟随两个“命名空间绑定”。

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

实际上第二个绑定并非总是必要的,但是除非你了解命名空间,我们强烈建议你包含它。欲了解更多信息,请看这个链接

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.

为什么Mozilla显示一个“XML解析错误”消息,而不是显示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">

确保你的所有的SVG文件都绑定了它。欲了解更多信息请阅读这个链接

为什么我们被要求选择一个程序以打开SVG文件?

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.

为什么我被要求安装一个插件以查看SVG文件?

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.

我需要如何在Mozilla SVG中报告bug?

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 contact us.

我可以使用一个SVG的插件代替Mozilla的原生支持吗?

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.

Mozilla的SVG编译器与Adobe的编译器相比如何?

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.

你该如何在Mozilla中安装Adobe的SVG浏览器?

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).

Mozilla可以与Corel的SVG插件共事吗?

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.

原生SVG支持以及SVG插件安装可以共存的吗?

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.

<embed> 标签支持SVG文档吗?

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.

我可以为SVG项目做什么?

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.

当前在做什么工作?

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.

Original Document Information

怎样和你联系?

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).

  • Author(s): Jonathan Watt
  • Last Updated Date: November 6, 2006
  • Copyright Information: Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:152 次

字数:14914

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文