OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <!-- | 3 <!-- |
4 Test adapted from https://mxr.mozilla.org/chromium/source/src/third_party/WebKit
/LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js | 4 Test adapted from https://dxr.mozilla.org/chromium/source/src/third_party/WebKit
/LayoutTests/fast/dom/TreeWalker/resources/TreeWalker-currentNode.js |
5 --> | 5 --> |
6 <head> | 6 <head> |
7 <title>TreeWalker: currentNode</title> | 7 <title>TreeWalker: currentNode</title> |
8 <script src="/resources/testharness.js"></script> | 8 <script src="/resources/testharness.js"></script> |
9 <script src="/resources/testharnessreport.js"></script> | 9 <script src="/resources/testharnessreport.js"></script> |
10 <script src="traversal-support.js"></script> | 10 <script src="traversal-support.js"></script> |
11 <div id=log></div> | 11 <div id=log></div> |
12 </head> | 12 </head> |
13 <body> | 13 <body> |
14 <div id='parent'> | 14 <div id='parent'> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 { | 64 { |
65 var w = document.createTreeWalker(subTree, NodeFilter.SHOW_ELEMENT, all); | 65 var w = document.createTreeWalker(subTree, NodeFilter.SHOW_ELEMENT, all); |
66 w.currentNode = subTree.previousSibling; | 66 w.currentNode = subTree.previousSibling; |
67 assert_equals(w.nextNode(), subTree); | 67 assert_equals(w.nextNode(), subTree); |
68 w.currentNode = document.getElementById("parent"); | 68 w.currentNode = document.getElementById("parent"); |
69 assert_equals(w.firstChild(), subTree); | 69 assert_equals(w.firstChild(), subTree); |
70 }, "Test how we handle the case when the traversed to node is within the root, b
ut the currentElement is not."); | 70 }, "Test how we handle the case when the traversed to node is within the root, b
ut the currentElement is not."); |
71 </script> | 71 </script> |
72 </body> | 72 </body> |
73 </html> | 73 </html> |
OLD | NEW |