OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>TreeWalker: Basic test</title> | 4 <title>TreeWalker: Basic test</title> |
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 <link rel="stylesheet" href="../../../resources/testharness.css"> | 7 <link rel="stylesheet" href="../../../resources/testharness.css"> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <p>This test checks the basic functionality of TreeWalker.</p> | 10 <p>This test checks the basic functionality of TreeWalker.</p> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { | 112 { |
113 var filter = function () { | 113 var filter = function () { |
114 return NodeFilter.FILTER_ACCEPT; | 114 return NodeFilter.FILTER_ACCEPT; |
115 }; | 115 }; |
116 [true, false].forEach(function (expandEntityReferences) { | 116 [true, false].forEach(function (expandEntityReferences) { |
117 var walker = document.createTreeWalker(createSampleDOM(), NodeFilter.SHO
W_ALL, filter, expandEntityReferences); | 117 var walker = document.createTreeWalker(createSampleDOM(), NodeFilter.SHO
W_ALL, filter, expandEntityReferences); |
118 assert_true(walker instanceof TreeWalker); | 118 assert_true(walker instanceof TreeWalker); |
119 assert_false(walker.expandEntityReferences); | 119 assert_false(walker.expandEntityReferences); |
120 }); | 120 }); |
121 }, 'Test that the fourth argument (expandEntityReferences) is ignored.'); | 121 }, 'Test that the fourth argument (expandEntityReferences) is ignored.'); |
| 122 |
| 123 test(function() { |
| 124 var treeWalker = document.createTreeWalker(document.body, 42, null); |
| 125 assert_equals(treeWalker.root, document.body); |
| 126 assert_equals(treeWalker.currentNode, document.body); |
| 127 assert_equals(treeWalker.whatToShow, 42); |
| 128 assert_equals(treeWalker.filter, null); |
| 129 }, "Optional arguments to createTreeWalker should be optional (3 passed, null)."
); |
122 </script> | 130 </script> |
123 </body> | 131 </body> |
124 </html> | 132 </html> |
OLD | NEW |