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 = [ |
+ "<g/>", |
+ "<body></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> |