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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Node-contains.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>Node.contains() tests</title>
3 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
4 <div id=log></div>
5 <script src=../../../../resources/testharness.js></script>
6 <script src=../../../../resources/testharnessreport.js></script>
7 <script src=../common.js></script>
8 <script>
9 "use strict";
10
11 testNodes.forEach(function(referenceName) {
12 var reference = eval(referenceName);
13
14 test(function() {
15 assert_false(reference.contains(null));
16 }, referenceName + ".contains(null)");
17
18 testNodes.forEach(function(otherName) {
19 var other = eval(otherName);
20 test(function() {
21 var ancestor = other;
22 while (ancestor && ancestor !== reference) {
23 ancestor = ancestor.parentNode;
24 }
25 if (ancestor === reference) {
26 assert_true(reference.contains(other));
27 } else {
28 assert_false(reference.contains(other));
29 }
30 }, referenceName + ".compareDocumentPosition(" + otherName + ")");
31 });
32 });
33
34 testDiv.parentNode.removeChild(testDiv);
35 </script>
36 <!-- vim: set expandtab tabstop=2 shiftwidth=2: -->
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698