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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Element.tagName</title>
3 <script src="../../../../resources/testharness.js"></script>
4 <script src="../../../../resources/testharnessreport.js"></script>
5 <div id="log"></div>
6 <script>
7 test(function() {
8 var HTMLNS = "http://www.w3.org/1999/xhtml"
9 assert_equals(document.createElementNS(HTMLNS, "I").tagName, "I")
10 assert_equals(document.createElementNS(HTMLNS, "i").tagName, "I")
11 assert_equals(document.createElementNS(HTMLNS, "x:b").tagName, "X:B")
12 }, "tagName should upper-case for HTML elements in HTML documents.")
13
14 test(function() {
15 var SVGNS = "http://www.w3.org/2000/svg"
16 assert_equals(document.createElementNS(SVGNS, "svg").tagName, "svg")
17 assert_equals(document.createElementNS(SVGNS, "SVG").tagName, "SVG")
18 assert_equals(document.createElementNS(SVGNS, "s:svg").tagName, "s:svg")
19 assert_equals(document.createElementNS(SVGNS, "s:SVG").tagName, "s:SVG")
20 }, "tagName should not upper-case for SVG elements in HTML documents.")
21
22 test(function() {
23 if ("DOMParser" in window) {
24 var xmlel = new DOMParser()
25 .parseFromString('<div xmlns="http://www.w3.org/1999/xhtml">Test</div>', ' text/xml')
26 .documentElement;
27 assert_equals(xmlel.tagName, "div", "tagName should be lowercase in XML")
28 var htmlel = document.importNode(xmlel, true)
29 assert_equals(htmlel.tagName, "DIV", "tagName should be uppercase in HTML")
30 }
31 }, "tagName should be updated when changing ownerDocument")
32
33 test(function() {
34 var xmlel = document.implementation
35 .createDocument("http://www.w3.org/1999/xhtml", "div", null)
36 .documentElement;
37 assert_equals(xmlel.tagName, "div", "tagName should be lowercase in XML")
38 var htmlel = document.importNode(xmlel, true)
39 assert_equals(htmlel.tagName, "DIV", "tagName should be uppercase in HTML")
40 }, "tagName should be updated when changing ownerDocument (createDocument withou t prefix)")
41
42 test(function() {
43 var xmlel = document.implementation
44 .createDocument("http://www.w3.org/1999/xhtml", "foo:div", null)
45 .documentElement;
46 assert_equals(xmlel.tagName, "foo:div", "tagName should be lowercase in XML")
47 var htmlel = document.importNode(xmlel, true)
48 assert_equals(htmlel.tagName, "FOO:DIV", "tagName should be uppercase in HTML" )
49 }, "tagName should be updated when changing ownerDocument (createDocument with p refix)")
50 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698