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

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

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: Created 4 years, 1 month 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 <title>Node.contains() tests</title> 2 <title>Node.contains() tests</title>
3 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name> 3 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
4 <div id=log></div> 4 <div id=log></div>
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 <script src=../common.js></script> 7 <script src=../common.js></script>
8 <script> 8 <script>
9 "use strict"; 9 "use strict";
10 10
11 testNodes.forEach(function(referenceName) { 11 testNodes.forEach(function(referenceName) {
12 var reference = eval(referenceName); 12 var reference = eval(referenceName);
13 13
14 test(function() { 14 test(function() {
15 assert_false(reference.contains(null)); 15 assert_false(reference.contains(null));
16 }, referenceName + ".contains(null)"); 16 }, referenceName + ".contains(null)");
17 17
18 testNodes.forEach(function(otherName) { 18 testNodes.forEach(function(otherName) {
19 var other = eval(otherName); 19 var other = eval(otherName);
20 test(function() { 20 test(function() {
21 var ancestor = other; 21 var ancestor = other;
22 while (ancestor && ancestor !== reference) { 22 while (ancestor && ancestor !== reference) {
23 ancestor = ancestor.parentNode; 23 ancestor = ancestor.parentNode;
24 } 24 }
25 if (ancestor === reference) { 25 if (ancestor === reference) {
26 assert_true(reference.contains(other)); 26 assert_true(reference.contains(other));
27 } else { 27 } else {
28 assert_false(reference.contains(other)); 28 assert_false(reference.contains(other));
29 } 29 }
30 }, referenceName + ".compareDocumentPosition(" + otherName + ")"); 30 }, referenceName + ".contains(" + otherName + ")");
31 }); 31 });
32 }); 32 });
33 33
34 testDiv.parentNode.removeChild(testDiv); 34 testDiv.parentNode.removeChild(testDiv);
35 </script> 35 </script>
36 <!-- vim: set expandtab tabstop=2 shiftwidth=2: --> 36 <!-- vim: set expandtab tabstop=2 shiftwidth=2: -->
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698