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

Unified Diff: LayoutTests/fast/innerHTML/innerHTML-xml.xhtml

Issue 52443003: Reland 160869 "Move innerHTML and outerHTML to Element" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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-xml.xhtml
diff --git a/LayoutTests/fast/innerHTML/innerHTML-xml.xhtml b/LayoutTests/fast/innerHTML/innerHTML-xml.xhtml
new file mode 100644
index 0000000000000000000000000000000000000000..56c027b4e5784a7d55287238f5ec67df3bcba0b4
--- /dev/null
+++ b/LayoutTests/fast/innerHTML/innerHTML-xml.xhtml
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <style>
+ </style>
+ </head>
+ <body>
+ <svg xmlns="http://www.w3.org/2000/svg"></svg>
+ <bar xmlns="http://test/foo"></bar>
+ <script>
+ description("Test innerHTML in XHTML/XML documents");
+
+ var namespaces = [
+ "http://www.w3.org/2000/svg",
+ "http://test/foo"
+ ];
+ var elementnames = [
+ "svg",
+ "bar"
+ ];
+ var texts = [
+ "&lt;g/>",
+ "&lt;body>&lt;/body>"
+
+ ];
+
+ var element, childns;
+ function g(ns, elementName, text, appendOrSelect) {
+ if (appendOrSelect == "append") {
+ element = document.createElementNS(ns, elementName);
+ document.body.appendChild(element);
+ childns = ns;
+ } else {
+ element = document.querySelector(elementName);
+ childns = element.namespaceURI;
+ }
+ element.innerHTML = text;
+ shouldBeEqualToString("element.firstChild.namespaceURI", childns);
+ }
+
+ namespaces.forEach(function(ns) {
+ elementnames.forEach(function(elementname) {
+ texts.forEach(function(text) {
+ g(ns, elementname, text, "append");
+ g(ns, elementname, text, "select");
+ });
+ });
+ });
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698