In eclipse RCP, there is SWT Browser Widget to render HTML and Javascript. I have been testing Eclipse 3.5.2 and try to open SVG embedded in HTML via SWT.MOZILLA Browser, it was successful. But if I embed the svg code directly into html tag, it was fail. For running SWT.MOZILLA, i use XulRunner 1.9.2.19. So does it means SWT Browser (MOZILLA, WEBKIT, NONE) don;t have SVG support? I know there is an alternative by using raphael.js. But currently, my program is using SVG file(s) provided by another program, and I don't think converting the SVG using raphael.js is an easy task.
UPDATE: There is readysetraphael.com which can convert SVG file into raphael.js, but for some reasons it fails to convert my SVG.
Firefox 3.6 (corresponding to XULRunner 1.9.2) is pretty old, it only has some basic SVG support. It does support inline SVG but you would need to use XHTML (properly served with MIME type application/xhtml+xml
on the web or using .xhtml
extension on your disk drive) and correct namespaces. Support for inline SVG in regular HTML files was only added with the HTML5 parser in Firefox 4 (corresponding to XULRunner 2.0). Firefox 3.6 also doesn't support SVG in an <img>
element, you would have to use <iframe>
or <embed>
.