OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../js/resources/js-test-pre.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <div style="visibility:hidden"> |
| 7 <svg></svg> |
| 8 </div> |
| 9 <script> |
| 10 description("Test that setting innerHTML and outerHTML properties works on SVG
elements"); |
| 11 var svg = document.getElementsByTagName('svg')[0]; |
| 12 |
| 13 svg.innerHTML = "<rect/>"; |
| 14 shouldBeEqualToString("svg.innerHTML", '<rect></rect>'); |
| 15 shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/s
vg'); |
| 16 |
| 17 svg.innerHTML = "<foreignobject><svg/></foreignobject>"; |
| 18 shouldBeEqualToString("svg.innerHTML", '<foreignObject><svg></svg></foreignObj
ect>'); |
| 19 shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/s
vg'); |
| 20 shouldBeEqualToString("svg.firstChild.firstChild.namespaceURI", 'http://www.w3
.org/2000/svg'); |
| 21 |
| 22 svg.innerHTML = "<foreignobject><p>x</foreignobject>"; |
| 23 shouldBeEqualToString("svg.innerHTML", '<foreignObject><p>x</p></foreignObject
>'); |
| 24 shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/s
vg'); |
| 25 shouldBeEqualToString("svg.firstChild.firstChild.namespaceURI", 'http://www.w3
.org/1999/xhtml'); |
| 26 |
| 27 svg.outerHTML = "<svg><circle/></svg>"; |
| 28 var svg = document.getElementsByTagName('svg')[0]; |
| 29 shouldBeEqualToString("svg.innerHTML", '<circle></circle>'); |
| 30 shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/s
vg'); |
| 31 </script> |
| 32 <script src="../js/resources/js-test-post.js"></script> |
| 33 </body> |
| 34 </html> |
OLD | NEW |