mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-18 13:17:29 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
57
testing/web-platform/tests/dom/traversal/unfinished/005.xml
Normal file
57
testing/web-platform/tests/dom/traversal/unfinished/005.xml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of the Reference Node (deep check)</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 AA = document.getElementById('AA');
|
||||
var B = document.getElementById('B');
|
||||
var C = document.getElementById('C');
|
||||
check(iterator.nextNode(), root);
|
||||
check(iterator.nextNode(), A);
|
||||
check(iterator.nextNode(), AA);
|
||||
check(iterator.nextNode(), B);
|
||||
remove(B);
|
||||
var X = addChildTo(AA);
|
||||
check(iterator.nextNode(), X);
|
||||
check(iterator.previousNode(), X);
|
||||
remove(X);
|
||||
var Y = addChildTo(AA);
|
||||
check(iterator.previousNode(), Y);
|
||||
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);
|
||||
}
|
||||
function addChildTo(a) {
|
||||
var x = document.createElementNS('http://www.w3.org/1999/xhtml', 'span');
|
||||
a.appendChild(x);
|
||||
return x;
|
||||
}
|
||||
]]></script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<pre id="result">FAIL: Script did not complete.</pre>
|
||||
<p><span id="root"><span id="A"><span id="AA"></span></span><span id="B"></span><span id="C"><span id="CC"></span></span></span></p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue