Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: LayoutTests/fast/innerHTML/innerHTML-svg-write.html

Issue 44333002: Move innerHTML and outerHTML to Element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased to latest master Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698