Re: Should svg work in less strict html5 documents with an html mime-type?

On Fri, 03 Sep 2010 04:55:38 +0200, Kevin Ar18 <kevinar18@hotmail.com>  
wrote:

>
>> On 9/2/10 8:21 PM, Kevin Ar18 wrote:
>> > I've noticed that when inserting svg into an html 5 document !DOCTYPE
>> > HTML that svg will not work.
>>
>> Inserted how? And tested how?
> I was running in Opera.  It wouldn't work in regular html like so:
> The basic layout:
> file.html
> <!DOCTYPE HTML>
> <html>
> <body>
> <svg>
> <rect>
> I wanted to see if I was misunderstanding the spec or it was a bug/lack  
> of support in the browser. 		 	   		

I would expect that to work in Opera as soon as the full HTML5 parser is  
added, however that has not yet been included in public builds.
Note: elm.innerHTML in current Opera builds isn't capable of inserting svg  
elements in the proper namespace.

I'm guessing that's how you inserted the svg content. Standard DOM 3 Core  
methods should work just fine for inserting and creating svg elements in  
all the browsers, including Opera.

Besides, if you need inline svg content to work in existing browsers then  
you'll likely need some hacks anyway, e.g script element wrappers, or  
serving as XHTML/SVG.

Cheers
/Erik

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Friday, 3 September 2010 08:45:26 UTC