| <html> |
| <head> |
| <script src="../../resources/js-test.js"></script> |
| </head> |
| <body> |
| <div style="visibility:hidden"> |
| <svg id="emptysvg"></svg> |
| <svg id="rectsvg"><rect/></svg> |
| <svg id="foreign" width="100" height="30"><foreignObject width="100" height="30"><p>html</p></foreignObject></svg> |
| </div> |
| <script> |
| description("Test that accessing innerHTML and outerHTML properties works on SVG elements"); |
| |
| var tests = [ |
| ['innerHTML("emptysvg")' , ''], |
| ['innerHTML("rectsvg")' , '<rect></rect>' ], |
| ['innerHTML("foreign")' , '<foreignObject width="100" height="30"><p>html</p></foreignObject>' ], |
| ['outerHTML("emptysvg")' , '<svg id="emptysvg"></svg>'], |
| ['outerHTML("rectsvg")' , '<svg id="rectsvg"><rect></rect></svg>' ], |
| ]; |
| |
| function innerHTML(id) { |
| return document.getElementById(id).innerHTML; |
| } |
| |
| function outerHTML(id) { |
| return document.getElementById(id).outerHTML; |
| } |
| |
| for (var i in tests) { |
| shouldBeEqualToString(tests[i][0], tests[i][1]); |
| } |
| </script> |
| </body> |
| </html> |