[whatwg] Inline SVG

Martin Atkins mart at degeneration.co.uk
Sat Dec 9 04:32:03 PST 2006


Michel Fortin wrote:
> 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.
> 
[snip]
 > <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.
> 

Using <script> has the ultimate advantage that existing browsers will 
*already* ignore it, while for some new element legacy browsers will 
attempt to parse the contents as HTML and may end up displaying 
something unintended. It's unclear how you'd implement fallback behavior 
for <script type="application/xml">, though, since the only fallback for 
<script> is <noscript>, which is ignored if the browser supports 
scripting of any kind, regardless of type.

This also raises an interesting question about how you'd embed an XML 
application that itself features a <script> element, since any </script> 
ends the parsing of the script element regardless of nesting. (The HTML 
parser just sees the XML as an opaque block of text.)





More information about the whatwg mailing list