foreign_content_006.html (1289B)
1 <!DOCTYPE html> 2 <html> 3 <svg width="100px" height="100px"> 4 <rect width="100px" height="100px" fill="none" /> 5 </svg> 6 7 <head> 8 <title>HTML 5 Foreign Content SVG in HTML </title> 9 <meta description="Test to verify SVG inside HTML 'HTML' element parses correctly" /> 10 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 11 <script type="text/javascript"> 12 function RunTest() 13 { 14 try 15 { 16 if(document.body.childNodes[0].localName=="svg") 17 { 18 document.getElementsByTagName("rect")[0].setAttribute("fill","green"); 19 } 20 else 21 { 22 document.getElementsByTagName("rect")[0].setAttribute("fill","red"); 23 } 24 } 25 catch(ex) 26 { 27 document.getElementsByTagName("rect")[0].setAttribute("fill","red") 28 } 29 } 30 </script> 31 </head> 32 33 <body onLoad="RunTest()"> 34 <div class="testdata"> 35 <p id="instructions">Test passes if a green rectangle is visible on the page above this line.</p> 36 </div> 37 </body> 38 </html>