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