[whatwg] Inline SVG

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

Received on Saturday, 9 December 2006 04:32:03 UTC