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 id="emptysvg"></svg> | |
8 <svg id="rectsvg"><rect/></svg> | |
9 <svg id="foreign" width="100" height="30"><foreignObject width="100" height="3 0"><p>html</p></foreignObject></svg> | |
10 </div> | |
11 <script> | |
12 description("Test that accessing the innerHTML property works on SVG elements"); | |
13 | |
14 var tests = [ | |
15 ['innerHTML("emptysvg")' , '""'], | |
16 ['innerHTML("rectsvg")' , '"<rect></rect>"' ], | |
17 ['innerHTML("foreign")' , '"<foreignObject width=\\"100\\" height=\\"30\\"> <p>html</p></foreignObject>"' ], | |
18 ['outerHTML("emptysvg")' , '"<svg id=\\"emptysvg\\"></svg>"'], | |
19 ['outerHTML("rectsvg")' , '"<svg id=\\"rectsvg\\"><rect></rect></svg>"' ], | |
20 ]; | |
21 | |
22 function innerHTML(id) { | |
23 return document.getElementById(id).innerHTML; | |
24 } | |
25 | |
26 function outerHTML(id) { | |
27 return document.getElementById(id).outerHTML; | |
28 } | |
29 | |
30 for (var i in tests) { | |
31 shouldBe(tests[i][0], tests[i][1]); | |
arv (Not doing code reviews)
2013/10/25 19:15:31
FYI. If you used shouldBeEqualToString you could s
davve
2013/10/25 19:50:45
Thank you!
| |
32 } | |
33 </script> | |
34 <script src="../js/resources/js-test-post.js"></script> | |
35 </body> | |
36 </html> | |
OLD | NEW |