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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/Node-cloneNode.html

Issue 2547023002: Import wpt@3c8896ae408c8fd594979da7c99970029e7856a7 (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>Node.cloneNode</title> 3 <title>Node.cloneNode</title>
4 <link rel=help href="https://dom.spec.whatwg.org/#dom-node-clonenode"> 4 <link rel=help href="https://dom.spec.whatwg.org/#dom-node-clonenode">
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <div id=log></div> 7 <div id=log></div>
8 <script> 8 <script>
9 function assert_equal_node(nodeA, nodeB) { 9 function assert_equal_node(nodeA, nodeB) {
10 assert_equals(nodeB.nodeType, nodeA.nodeType, "nodeType"); 10 assert_equals(nodeB.nodeType, nodeA.nodeType, "nodeType");
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 } 28 }
29 29
30 function check_copy(orig, copy, type) { 30 function check_copy(orig, copy, type) {
31 assert_not_equals(orig, copy); 31 assert_not_equals(orig, copy);
32 assert_equal_node(orig, copy); 32 assert_equal_node(orig, copy);
33 assert_true(orig instanceof type, "Should be type"); 33 assert_true(orig instanceof type, "Should be type");
34 assert_true(copy instanceof type, "Should be type"); 34 assert_true(copy instanceof type, "Should be type");
35 } 35 }
36 36
37 function create_element_and_check(localName, type) { 37 function create_element_and_check(localName, typeName) {
38 test(function() { 38 test(function() {
39 assert_true(typeName in window, typeName + " is not supported");
39 var element = document.createElement(localName); 40 var element = document.createElement(localName);
40 var copy = element.cloneNode(); 41 var copy = element.cloneNode();
41 check_copy(element, copy, type); 42 check_copy(element, copy, window[typeName]);
42 }, "createElement(" + localName + ")"); 43 }, "createElement(" + localName + ")");
43 } 44 }
44 45
45 // test1: createElement 46 // test1: createElement
46 test(function() { 47 create_element_and_check("a", "HTMLAnchorElement");
47 create_element_and_check("a", HTMLAnchorElement); 48 create_element_and_check("abbr", "HTMLElement");
48 create_element_and_check("abbr", HTMLElement); 49 create_element_and_check("acronym", "HTMLElement");
49 create_element_and_check("acronym", HTMLElement); 50 create_element_and_check("address", "HTMLElement");
50 create_element_and_check("address", HTMLElement); 51 create_element_and_check("applet", "HTMLAppletElement");
51 create_element_and_check("applet", HTMLAppletElement); 52 create_element_and_check("area", "HTMLAreaElement");
52 create_element_and_check("area", HTMLAreaElement); 53 create_element_and_check("article", "HTMLElement");
53 create_element_and_check("article", HTMLElement); 54 create_element_and_check("aside", "HTMLElement");
54 create_element_and_check("aside", HTMLElement); 55 create_element_and_check("audio", "HTMLAudioElement");
55 create_element_and_check("audio", HTMLAudioElement); 56 create_element_and_check("b", "HTMLElement");
56 create_element_and_check("b", HTMLElement); 57 create_element_and_check("base", "HTMLBaseElement");
57 create_element_and_check("base", HTMLBaseElement); 58 create_element_and_check("bdi", "HTMLElement");
58 create_element_and_check("bdi", HTMLElement); 59 create_element_and_check("bdo", "HTMLElement");
59 create_element_and_check("bdo", HTMLElement); 60 create_element_and_check("bgsound", "HTMLElement");
60 create_element_and_check("bgsound", HTMLElement); 61 create_element_and_check("big", "HTMLElement");
61 create_element_and_check("big", HTMLElement); 62 create_element_and_check("blockquote","HTMLElement");
62 create_element_and_check("blockquote",HTMLElement); 63 create_element_and_check("body", "HTMLBodyElement");
63 create_element_and_check("body", HTMLBodyElement); 64 create_element_and_check("br", "HTMLBRElement");
64 create_element_and_check("br", HTMLBRElement); 65 create_element_and_check("button", "HTMLButtonElement");
65 create_element_and_check("button", HTMLButtonElement); 66 create_element_and_check("canvas", "HTMLCanvasElement");
66 create_element_and_check("canvas", HTMLCanvasElement); 67 create_element_and_check("caption", "HTMLTableCaptionElement");
67 create_element_and_check("caption", HTMLTableCaptionElement); 68 create_element_and_check("center", "HTMLElement");
68 create_element_and_check("center", HTMLElement); 69 create_element_and_check("cite", "HTMLElement");
69 create_element_and_check("cite", HTMLElement); 70 create_element_and_check("code", "HTMLElement");
70 create_element_and_check("code", HTMLElement); 71 create_element_and_check("col", "HTMLTableColElement");
71 create_element_and_check("col", HTMLTableColElement); 72 create_element_and_check("colgroup", "HTMLTableColElement");
72 create_element_and_check("colgroup", HTMLTableColElement); 73 create_element_and_check("data", "HTMLDataElement");
73 create_element_and_check("data", HTMLDataElement); 74 create_element_and_check("datalist", "HTMLDataListElement");
74 create_element_and_check("datalist", HTMLDataListElement); 75 create_element_and_check("dialog", "HTMLDialogElement");
75 create_element_and_check("dialog", HTMLDialogElement); 76 create_element_and_check("dd", "HTMLElement");
76 create_element_and_check("dd", HTMLElement); 77 create_element_and_check("del", "HTMLModElement");
77 create_element_and_check("del", HTMLModElement); 78 create_element_and_check("details", "HTMLElement");
78 create_element_and_check("details", HTMLElement); 79 create_element_and_check("dfn", "HTMLElement");
79 create_element_and_check("dfn", HTMLElement); 80 create_element_and_check("dir", "HTMLDirectoryElement");
80 create_element_and_check("dir", HTMLDirectoryElement); 81 create_element_and_check("div", "HTMLDivElement");
81 create_element_and_check("div", HTMLDivElement); 82 create_element_and_check("dl", "HTMLDListElement");
82 create_element_and_check("dl", HTMLDListElement); 83 create_element_and_check("dt", "HTMLElement");
83 create_element_and_check("dt", HTMLElement); 84 create_element_and_check("embed", "HTMLEmbedElement");
84 create_element_and_check("embed", HTMLEmbedElement); 85 create_element_and_check("fieldset", "HTMLFieldSetElement");
85 create_element_and_check("fieldset", HTMLFieldSetElement); 86 create_element_and_check("figcaption","HTMLElement");
86 create_element_and_check("figcaption",HTMLElement); 87 create_element_and_check("figure", "HTMLElement");
87 create_element_and_check("figure", HTMLElement); 88 create_element_and_check("font", "HTMLFontElement");
88 create_element_and_check("font", HTMLFontElement); 89 create_element_and_check("footer", "HTMLElement");
89 create_element_and_check("footer", HTMLElement); 90 create_element_and_check("form", "HTMLFormElement");
90 create_element_and_check("form", HTMLFormElement); 91 create_element_and_check("frame", "HTMLFrameElement");
91 create_element_and_check("frame", HTMLFrameElement); 92 create_element_and_check("frameset", "HTMLFrameSetElement");
92 create_element_and_check("frameset", HTMLFrameSetElement); 93 create_element_and_check("h1", "HTMLHeadingElement");
93 create_element_and_check("h1", HTMLHeadingElement); 94 create_element_and_check("h2", "HTMLHeadingElement");
94 create_element_and_check("h2", HTMLHeadingElement); 95 create_element_and_check("h3", "HTMLHeadingElement");
95 create_element_and_check("h3", HTMLHeadingElement); 96 create_element_and_check("h4", "HTMLHeadingElement");
96 create_element_and_check("h4", HTMLHeadingElement); 97 create_element_and_check("h5", "HTMLHeadingElement");
97 create_element_and_check("h5", HTMLHeadingElement); 98 create_element_and_check("h6", "HTMLHeadingElement");
98 create_element_and_check("h6", HTMLHeadingElement); 99 create_element_and_check("head", "HTMLHeadElement");
99 create_element_and_check("head", HTMLHeadElement); 100 create_element_and_check("header", "HTMLElement");
100 create_element_and_check("header", HTMLElement); 101 create_element_and_check("hgroup", "HTMLElement");
101 create_element_and_check("hgroup", HTMLElement); 102 create_element_and_check("hr", "HTMLHRElement");
102 create_element_and_check("hr", HTMLHRElement); 103 create_element_and_check("html", "HTMLHtmlElement");
103 create_element_and_check("html", HTMLHtmlElement); 104 create_element_and_check("i", "HTMLElement");
104 create_element_and_check("i", HTMLElement); 105 create_element_and_check("iframe", "HTMLIFrameElement");
105 create_element_and_check("iframe", HTMLIFrameElement); 106 create_element_and_check("img", "HTMLImageElement");
106 create_element_and_check("img", HTMLImageElement); 107 create_element_and_check("input", "HTMLInputElement");
107 create_element_and_check("input", HTMLInputElement); 108 create_element_and_check("ins", "HTMLModElement");
108 create_element_and_check("ins", HTMLModElement); 109 create_element_and_check("isindex", "HTMLElement");
109 create_element_and_check("isindex", HTMLElement); 110 create_element_and_check("kbd", "HTMLElement");
110 create_element_and_check("kbd", HTMLElement); 111 create_element_and_check("label", "HTMLLabelElement");
111 create_element_and_check("label", HTMLLabelElement); 112 create_element_and_check("legend", "HTMLLegendElement");
112 create_element_and_check("legend", HTMLLegendElement); 113 create_element_and_check("li", "HTMLLIElement");
113 create_element_and_check("li", HTMLLIElement); 114 create_element_and_check("link", "HTMLLinkElement");
114 create_element_and_check("link", HTMLLinkElement); 115 create_element_and_check("main", "HTMLElement");
115 create_element_and_check("main", HTMLElement); 116 create_element_and_check("map", "HTMLMapElement");
116 create_element_and_check("map", HTMLMapElement); 117 create_element_and_check("mark", "HTMLElement");
117 create_element_and_check("mark", HTMLElement); 118 create_element_and_check("marquee", "HTMLElement");
118 create_element_and_check("marquee", HTMLElement); 119 create_element_and_check("meta", "HTMLMetaElement");
119 create_element_and_check("meta", HTMLMetaElement); 120 create_element_and_check("meter", "HTMLMeterElement");
120 create_element_and_check("meter", HTMLMeterElement); 121 create_element_and_check("nav", "HTMLElement");
121 create_element_and_check("nav", HTMLElement); 122 create_element_and_check("nobr", "HTMLElement");
122 create_element_and_check("nobr", HTMLElement); 123 create_element_and_check("noframes", "HTMLElement");
123 create_element_and_check("noframes", HTMLElement); 124 create_element_and_check("noscript", "HTMLElement");
124 create_element_and_check("noscript", HTMLElement); 125 create_element_and_check("object", "HTMLObjectElement");
125 create_element_and_check("object", HTMLObjectElement); 126 create_element_and_check("ol", "HTMLOListElement");
126 create_element_and_check("ol", HTMLOListElement); 127 create_element_and_check("optgroup", "HTMLOptGroupElement");
127 create_element_and_check("optgroup", HTMLOptGroupElement); 128 create_element_and_check("option", "HTMLOptionElement");
128 create_element_and_check("option", HTMLOptionElement); 129 create_element_and_check("output", "HTMLOutputElement");
129 create_element_and_check("output", HTMLOutputElement); 130 create_element_and_check("p", "HTMLParagraphElement");
130 create_element_and_check("p", HTMLParagraphElement); 131 create_element_and_check("param", "HTMLParamElement");
131 create_element_and_check("param", HTMLParamElement); 132 create_element_and_check("pre", "HTMLPreElement");
132 create_element_and_check("pre", HTMLPreElement); 133 create_element_and_check("progress", "HTMLProgressElement");
133 create_element_and_check("progress", HTMLProgressElement); 134 create_element_and_check("q", "HTMLQuoteElement");
134 create_element_and_check("q", HTMLQuoteElement); 135 create_element_and_check("rp", "HTMLElement");
135 create_element_and_check("rp", HTMLElement); 136 create_element_and_check("rt", "HTMLElement");
136 create_element_and_check("rt", HTMLElement); 137 create_element_and_check("ruby", "HTMLElement");
137 create_element_and_check("ruby", HTMLElement); 138 create_element_and_check("s", "HTMLElement");
138 create_element_and_check("s", HTMLElement); 139 create_element_and_check("samp", "HTMLElement");
139 create_element_and_check("samp", HTMLElement); 140 create_element_and_check("script", "HTMLScriptElement");
140 create_element_and_check("script", HTMLScriptElement); 141 create_element_and_check("section", "HTMLElement");
141 create_element_and_check("section", HTMLElement); 142 create_element_and_check("select", "HTMLSelectElement");
142 create_element_and_check("select", HTMLSelectElement); 143 create_element_and_check("small", "HTMLElement");
143 create_element_and_check("small", HTMLElement); 144 create_element_and_check("source", "HTMLSourceElement");
144 create_element_and_check("source", HTMLSourceElement); 145 create_element_and_check("spacer", "HTMLElement");
145 create_element_and_check("spacer", HTMLElement); 146 create_element_and_check("span", "HTMLSpanElement");
146 create_element_and_check("span", HTMLSpanElement); 147 create_element_and_check("strike", "HTMLElement");
147 create_element_and_check("strike", HTMLElement); 148 create_element_and_check("style", "HTMLStyleElement");
148 create_element_and_check("style", HTMLStyleElement); 149 create_element_and_check("sub", "HTMLElement");
149 create_element_and_check("sub", HTMLElement); 150 create_element_and_check("summary", "HTMLElement");
150 create_element_and_check("summary", HTMLElement); 151 create_element_and_check("sup", "HTMLElement");
151 create_element_and_check("sup", HTMLElement); 152 create_element_and_check("table", "HTMLTableElement");
152 create_element_and_check("table", HTMLTableElement); 153 create_element_and_check("tbody", "HTMLTableSectionElement");
153 create_element_and_check("tbody", HTMLTableSectionElement); 154 create_element_and_check("td", "HTMLTableCellElement");
154 create_element_and_check("td", HTMLTableCellElement); 155 create_element_and_check("template", "HTMLTemplateElement");
155 create_element_and_check("template", HTMLTemplateElement); 156 create_element_and_check("textarea", "HTMLTextAreaElement");
156 create_element_and_check("textarea", HTMLTextAreaElement); 157 create_element_and_check("th", "HTMLTableCellElement");
157 create_element_and_check("th", HTMLTableCellElement); 158 create_element_and_check("time", "HTMLTimeElement");
158 create_element_and_check("time", HTMLTimeElement); 159 create_element_and_check("title", "HTMLTitleElement");
159 create_element_and_check("title", HTMLTitleElement); 160 create_element_and_check("tr", "HTMLTableRowElement");
160 create_element_and_check("tr", HTMLTableRowElement); 161 create_element_and_check("tt", "HTMLElement");
161 create_element_and_check("tt", HTMLElement); 162 create_element_and_check("track", "HTMLTrackElement");
162 create_element_and_check("track", HTMLTrackElement); 163 create_element_and_check("u", "HTMLElement");
163 create_element_and_check("u", HTMLElement); 164 create_element_and_check("ul", "HTMLUListElement");
164 create_element_and_check("ul", HTMLUListElement); 165 create_element_and_check("var", "HTMLElement");
165 create_element_and_check("var", HTMLElement); 166 create_element_and_check("video", "HTMLVideoElement");
166 create_element_and_check("video", HTMLVideoElement); 167 create_element_and_check("unknown", "HTMLUnknownElement");
167 create_element_and_check("unknown", HTMLUnknownElement); 168 create_element_and_check("wbr", "HTMLElement");
168 create_element_and_check("wbr", HTMLElement);
169 }, "");
170 169
171 test(function() { 170 test(function() {
172 var fragment = document.createDocumentFragment(); 171 var fragment = document.createDocumentFragment();
173 var copy = fragment.cloneNode(); 172 var copy = fragment.cloneNode();
174 check_copy(fragment, copy, DocumentFragment); 173 check_copy(fragment, copy, DocumentFragment);
175 }, "createDocumentFragment"); 174 }, "createDocumentFragment");
176 175
177 test(function() { 176 test(function() {
178 var text = document.createTextNode("hello world"); 177 var text = document.createTextNode("hello world");
179 var copy = text.cloneNode(); 178 var copy = text.cloneNode();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 assert_equals(copy.childNodes[1].childNodes.length, 1); 262 assert_equals(copy.childNodes[1].childNodes.length, 1);
264 check_copy(grandChild, copy.childNodes[1].childNodes[0], HTMLDivElement); 263 check_copy(grandChild, copy.childNodes[1].childNodes[0], HTMLDivElement);
265 264
266 deep = false; 265 deep = false;
267 copy = parent.cloneNode(deep); 266 copy = parent.cloneNode(deep);
268 267
269 check_copy(parent, copy, HTMLDivElement); 268 check_copy(parent, copy, HTMLDivElement);
270 assert_equals(copy.childNodes.length, 0); 269 assert_equals(copy.childNodes.length, 0);
271 }, "node with children"); 270 }, "node with children");
272 </script> 271 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698