W3C home > Mailing lists > Public > www-svg@w3.org > July 2009

Re: Forcing browsers to render SVG in text/html context

From: Helder Magalh„es <helder.magalhaes@gmail.com>
Date: Wed, 22 Jul 2009 23:18:39 +0100
Message-ID: <2a1ddf8a0907221518v1ad9dfe0y7710ab8d89556622@mail.gmail.com>
To: Robin Berjon <robin@berjon.com>
Cc: www-svg WG <www-svg@w3.org>, svg-developers@yahoogroups.com
Hi Robin,


> just a quick email to point to this small JS library I've made that makes it
> possible to embed SVG in HTML served as vanilla text/html, and have it
> render nevertheless.

Cool! :-)  I've made a set of somehow related experiments, a couple of
months ago, but wasn't able to publish anything interesting about it
yet... :-(  The idea was to use IE8's improved namespace support [1]
to allow SVG-in-HTML integration, triggering a SVG rendering plug-in
(currently only ASV seems to work properly) whenever SVG content is
found (through an XML namespace declaration). Unfortunately, the
approach seems to work as expected cross-browser only in text/xml,
whereas in text/html (ironically) only IE seems to work... I really
need to find more time to make a few more experiments. :-)


Regarding the implementation, I've noticed that the approach seems to
use cloneNode: I recall Holger Will presenting a similar, XSLT-based
approach a while ago [2] (see "Handle Internet Explorer"). Also, in
the documentation it's stated that "In Internet Explorer it should do
basically nothing." [3]: I'm getting an error in IE8 [4] (on Windows
XP SP3) while visiting the demo. Perhaps using the IE-way of doing DOM
parsing [5], combined with the (proprietary) import [6] statement,
then IE+ASV could be supported also... But who cares? ;-D


> [...] Sorry about the delay, my daughter was born which caused
> distraction ;-)

Congratulations!!! :-)


Best regards,
 Helder


P.S.: Is 2017 [7] your lucky number? ;-)


[1] http://msdn.microsoft.com/en-us/library/dd565690(VS.85).aspx
[2] http://www.treebuilder.de/default.asp?file=621700.xml
[3] http://berjon.com/hacks/force-svg/
[4] Message: 'DOMParser' is undefined
    Line: 107
    Char: 9
    Code: 0
    URI: http://berjon.com/js/force-svg.js
[5] http://www.w3schools.com/Dom/dom_parser.asp
[6] http://www.schepers.cc/inlinesvg.html
[7] http://berjon.com/js/force-svg.js
Received on Wednesday, 22 July 2009 22:19:15 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:42 GMT