[whatwg] Inline SVG

Michel Fortin michel.fortin at michelf.com
Fri Dec 8 13:12:49 PST 2006


Le 8 déc. 2006 à 15:20, Leons Petrazickis a écrit :

> <http://listserver.dreamhost.com/pipermail/whatwg-whatwg.org/2006- 
> December/008444.html>
>
> Unlike Michel Fortin's proposal for <script
> type="image/svg+xml"></script>, I suggest that SVG included like this
> be rendered as an image in that exact spot. We may want to define a
> default height and width for all <inline-xml>...</inline-xml> content.

Well, my idea was that the XML content inside <script type="some xml  
media type"> would be parsed then inserted into the DOM right after  
the script element. In the case of SVG content, that would make the  
image appear exactly where the script tag is.

The XML "script" should be seen in exactly the same way as some  
previous JavaScript that was shown to build a SVG WHATWG logo, only  
the "script" would use an XML syntax instead of JavaScript. In case  
of any parse error, the XML "script" aborts and you get a partial XML  
tree in the DOM plus an error on the script console.

I'm not against using a different tag name, but I don't really see  
the point either. <script> is already parsed as text content by  
current browsers, so for current browsers that can't "execute the  
script", it would be possible for an external JavaScript to parse the  
content, build, and insert the new elements into the DOM.

What worries me most is what IE is going to do with it, because it's  
identical to one of the documented syntaxes for its XML islands. It's  
possible that it "just work" however. I guess someone should test  
that. (It's not very practical for me to check things with IE.)


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/


More information about the whatwg mailing list