foreign_content_005.html (1559B)
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 FORM 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("form")[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 green rectangle is visible below 'FillerText1'.</p> 34 </div> 35 <div> 36 FillerText1 37 <form> 38 <svg width="100px" height="100px"> 39 <rect width="100px" height="100px" fill="none" /> 40 </svg> 41 </form> 42 43 </div> 44 </body> 45 </html>