diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/dom/traversal/unfinished/008.xml | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/dom/traversal/unfinished/008.xml')
-rw-r--r-- | testing/web-platform/tests/dom/traversal/unfinished/008.xml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/traversal/unfinished/008.xml b/testing/web-platform/tests/dom/traversal/unfinished/008.xml new file mode 100644 index 0000000000..41d7008ae4 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/008.xml @@ -0,0 +1,48 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (backwards)</title> + <script type="text/javascript"> <![CDATA[ + var errors = 0; + var log = ''; + function doTest() { + var iterator = document.createNodeIterator(document.getElementById('root'), NodeFilter.SHOW_ALL, null, false); + var root = document.getElementById('root'); + var A = document.getElementById('A'); + var B = document.getElementById('B'); + var BB = document.getElementById('BB'); + var C = document.getElementById('C'); + check(iterator.nextNode(), root); + check(iterator.nextNode(), A); + check(iterator.nextNode(), B); + check(iterator.nextNode(), BB); + check(iterator.previousNode(), BB); + remove(B); + check(iterator.nextNode(), C); + if (errors) + document.getElementById('result').firstChild.data = 'FAIL: ' + errors + ' errors:\n' + log; + else + document.getElementById('result').firstChild.data = 'PASS'; + } + function check(a, b) { + if (!a) { + errors += 1; + log += 'Found null but expected ' + b + ' (' + b.id + ').\n'; + } else if (a != b) { + errors += 1; + log += 'Found ' + a + ' (' + a.id + ') but expected ' + b + ' (' + b.id + ').\n'; + } + } + function remove(a) { + if (!a) { + errors += 1; + log += 'Tried removing null node.\n'; + } else + a.parentNode.removeChild(a); + } + ]]></script> + </head> + <body onload="doTest()"> + <pre id="result">FAIL: Script did not complete.</pre> + <p><span id="root"><span id="A"></span><span id="B"><span id="BB"></span></span><span id="C"></span></span></p> + </body> +</html> |