foreign_content_003.html (1648B)
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 BUTTON 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("button")[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 33 <div class="testdata"> 34 <p id="instructions">Test passes if the button has a green rectangle while 'FillerText1' and 'FillerText3' are on either side of the button.</p> 35 </div> 36 <div> 37 FillerText1 38 <button> 39 <svg width="100px" height="100px"> 40 <rect width="100px" height="100px" fill="none" /> 41 </svg> 42 43 </button> 44 FillerText3 45 </div> 46 </body> 47 </html>