diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
commit | ceadffab6b357723981a429e11222daf6cd6dcfb (patch) | |
tree | 5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html | |
parent | 14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff) | |
parent | ad5a13bd501e379517da1a944c104a11d951a3f5 (diff) | |
download | UXP-RC_20210225.tar UXP-RC_20210225.tar.gz UXP-RC_20210225.tar.lz UXP-RC_20210225.tar.xz UXP-RC_20210225.zip |
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html')
-rw-r--r-- | testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html deleted file mode 100644 index 567ef6655..000000000 --- a/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -Test adapted from https://dxr.mozilla.org/chromium/source/src/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js ---> -<head> -<title>TreeWalker: traversal-skip-most</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="traversal-support.js"></script> -<div id=log></div> -</head> -<body> -<p>Test TreeWalker with skipping</p> -<script> -var testElement; -setup(function() { - testElement = document.createElement("div"); - testElement.id = 'root'; - // testElement.innerHTML='<div id="A1"><div id="B1" class="keep"></div><div id="B2">this text matters</div><div id="B3" class="keep"></div></div>'; - // <div id="A1"> - // <div id="B1" class="keep"></div> - // <div id="B2">this text matters</div> - // <div id="B3" class="keep"></div> - // </div> - - - // XXX for Servo, build the tree without using innerHTML - var a1 = document.createElement("div"); a1.id = "A1"; - var b1 = document.createElement("div"); b1.id = "B1"; b1.className = "keep"; - var b2 = document.createElement("div"); b2.id = "B2"; - var b3 = document.createElement("div"); b3.id = "B3"; b3.className = "keep"; - - testElement.appendChild(a1); - a1.appendChild(b1); - a1.appendChild(b2) - .appendChild(document.createTextNode("this text matters")); - a1.appendChild(b3); -}); - -var filter = { - acceptNode: function(node) { - if (node.className == 'keep') - return NodeFilter.FILTER_ACCEPT; - - return NodeFilter.FILTER_SKIP; - } -} - -test(function() -{ - var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter); - assert_node(walker.firstChild(), { type: Element, id: 'B1' }); - assert_node(walker.nextSibling(), { type: Element, id: 'B3' }); -}, 'Testing nextSibling'); - -test(function() -{ - var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter); - walker.currentNode = testElement.querySelectorAll('#B3')[0]; - assert_node(walker.previousSibling(), { type: Element, id: 'B1' }); -}, 'Testing previousSibling'); - -</script> -</body> -</html> |