Index: LayoutTests/fast/innerHTML/innerHTML-svg-write.html |
diff --git a/LayoutTests/fast/innerHTML/innerHTML-svg-write.html b/LayoutTests/fast/innerHTML/innerHTML-svg-write.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a9666a34e1044424d280238048034899133a9728 |
--- /dev/null |
+++ b/LayoutTests/fast/innerHTML/innerHTML-svg-write.html |
@@ -0,0 +1,34 @@ |
+<html> |
+<head> |
+<script src="../js/resources/js-test-pre.js"></script> |
+</head> |
+<body> |
+<div style="visibility:hidden"> |
+ <svg></svg> |
+</div> |
+<script> |
+ description("Test that setting innerHTML and outerHTML properties works on SVG elements"); |
+ var svg = document.getElementsByTagName('svg')[0]; |
+ |
+ svg.innerHTML = "<rect/>"; |
+ shouldBeEqualToString("svg.innerHTML", '<rect></rect>'); |
+ shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/svg'); |
+ |
+ svg.innerHTML = "<foreignobject><svg/></foreignobject>"; |
+ shouldBeEqualToString("svg.innerHTML", '<foreignObject><svg></svg></foreignObject>'); |
+ shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/svg'); |
+ shouldBeEqualToString("svg.firstChild.firstChild.namespaceURI", 'http://www.w3.org/2000/svg'); |
+ |
+ svg.innerHTML = "<foreignobject><p>x</foreignobject>"; |
+ shouldBeEqualToString("svg.innerHTML", '<foreignObject><p>x</p></foreignObject>'); |
+ shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/svg'); |
+ shouldBeEqualToString("svg.firstChild.firstChild.namespaceURI", 'http://www.w3.org/1999/xhtml'); |
+ |
+ svg.outerHTML = "<svg><circle/></svg>"; |
+ var svg = document.getElementsByTagName('svg')[0]; |
+ shouldBeEqualToString("svg.innerHTML", '<circle></circle>'); |
+ shouldBeEqualToString("svg.firstChild.namespaceURI", 'http://www.w3.org/2000/svg'); |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |