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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Element-tagName.html

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Element-tagName.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Element-tagName.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Element-tagName.html
new file mode 100644
index 0000000000000000000000000000000000000000..7e7ffeff2e46ed91763d2f0a02f38c906930aa21
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Element-tagName.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Element.tagName</title>
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var HTMLNS = "http://www.w3.org/1999/xhtml"
+ assert_equals(document.createElementNS(HTMLNS, "I").tagName, "I")
+ assert_equals(document.createElementNS(HTMLNS, "i").tagName, "I")
+ assert_equals(document.createElementNS(HTMLNS, "x:b").tagName, "X:B")
+}, "tagName should upper-case for HTML elements in HTML documents.")
+
+test(function() {
+ var SVGNS = "http://www.w3.org/2000/svg"
+ assert_equals(document.createElementNS(SVGNS, "svg").tagName, "svg")
+ assert_equals(document.createElementNS(SVGNS, "SVG").tagName, "SVG")
+ assert_equals(document.createElementNS(SVGNS, "s:svg").tagName, "s:svg")
+ assert_equals(document.createElementNS(SVGNS, "s:SVG").tagName, "s:SVG")
+}, "tagName should not upper-case for SVG elements in HTML documents.")
+
+test(function() {
+ if ("DOMParser" in window) {
+ var xmlel = new DOMParser()
+ .parseFromString('<div xmlns="http://www.w3.org/1999/xhtml">Test</div>', 'text/xml')
+ .documentElement;
+ assert_equals(xmlel.tagName, "div", "tagName should be lowercase in XML")
+ var htmlel = document.importNode(xmlel, true)
+ assert_equals(htmlel.tagName, "DIV", "tagName should be uppercase in HTML")
+ }
+}, "tagName should be updated when changing ownerDocument")
+
+test(function() {
+ var xmlel = document.implementation
+ .createDocument("http://www.w3.org/1999/xhtml", "div", null)
+ .documentElement;
+ assert_equals(xmlel.tagName, "div", "tagName should be lowercase in XML")
+ var htmlel = document.importNode(xmlel, true)
+ assert_equals(htmlel.tagName, "DIV", "tagName should be uppercase in HTML")
+}, "tagName should be updated when changing ownerDocument (createDocument without prefix)")
+
+test(function() {
+ var xmlel = document.implementation
+ .createDocument("http://www.w3.org/1999/xhtml", "foo:div", null)
+ .documentElement;
+ assert_equals(xmlel.tagName, "foo:div", "tagName should be lowercase in XML")
+ var htmlel = document.importNode(xmlel, true)
+ assert_equals(htmlel.tagName, "FOO:DIV", "tagName should be uppercase in HTML")
+}, "tagName should be updated when changing ownerDocument (createDocument with prefix)")
+</script>

Powered by Google App Engine
This is Rietveld 408576698