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