test_bug811701.xhtml (1997B)
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <!-- 3 https://bugzilla.mozilla.org/show_bug.cgi?id=811701 4 --> 5 <head> 6 <title>Test for Bug 811701</title> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 9 </head> 10 <body> 11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811701">Mozilla Bug 811701</a> 12 <p id="display"></p> 13 <div id="content" style="display: none"> 14 <math xmlns="http://www.w3.org/1998/Math/MathML"><mtext>test</mtext></math> 15 <svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 100,100 200,300"/></svg> 16 </div> 17 <pre id="test"> 18 </pre> 19 <script type="application/javascript"> 20 <![CDATA[ 21 22 23 /** Test for Bug 811701 */ 24 var math = document.querySelector("math"); 25 is(math.innerHTML, 26 '<mtext xmlns="http://www.w3.org/1998/Math/MathML">test</mtext>', 27 "<math> should have innerHTML"); 28 is(math.outerHTML, 29 '<math xmlns="http://www.w3.org/1998/Math/MathML"><mtext>test</mtext></math>', 30 "<math> should have innerHTML"); 31 math.innerHTML = "<mo>+</mo>"; 32 is(math.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML", 33 "Should have the right namespace after setting innerHTML on <math>"); 34 35 var polygon = document.querySelector("polygon"); 36 is(polygon.parentNode.innerHTML, 37 '<polygon xmlns="http://www.w3.org/2000/svg" points="0,0 100,100 200,300"/>', 38 "<svg> should have innerHTML"); 39 is(polygon.parentNode.outerHTML, 40 '<svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 100,100 200,300"/></svg>', 41 "<svg> should have outerHTML"); 42 is(polygon.outerHTML, '<polygon xmlns="http://www.w3.org/2000/svg" points="0,0 100,100 200,300"/>', 43 "<polygon> should have outerHTML"); 44 45 var svg = document.querySelector("svg"); 46 svg.innerHTML = "<rect/>"; 47 is(svg.firstChild.namespaceURI, "http://www.w3.org/2000/svg", 48 "Should have the right namespace after setting innerHTML on <math>"); 49 ]]> 50 </script> 51 </body> 52 </html>