foreign_content_001.html (1508B)
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 OBJECT 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 var svgNS = "http://www.w3.org/2000/svg"; 14 if(document.getElementsByTagName("object")[0].childNodes[1].localName=="svg" && document.getElementsByTagName("rect")[0].namespaceURI==svgNS) 15 { 16 document.getElementsByTagName("rect")[0].setAttribute("fill","green"); 17 } 18 else 19 { 20 document.getElementsByTagName("rect")[0].setAttribute("fill","red"); 21 } 22 } 23 catch(ex) 24 { 25 document.getElementsByTagName("rect")[0].setAttribute("fill","red") 26 } 27 } 28 </script> 29 </head> 30 31 <body onLoad="RunTest()"> 32 <div class="testdata"> 33 <p id="instructions"> Test passes if a green rectangle is visible on the page below this line. </p> 34 </div> 35 36 <object> 37 <svg width="100px" height="100px" > 38 <rect width="100px" height="100px" fill="none"/> 39 </svg> 40 </object> 41 </body> 42 43 </html>