mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 00:17:32 +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
53
testing/web-platform/tests/dom/traversal/unfinished/001.xml
Normal file
53
testing/web-platform/tests/dom/traversal/unfinished/001.xml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Basics</title>
|
||||
<script type="text/javascript"> <![CDATA[
|
||||
function doTest() {
|
||||
var iterator = document.createNodeIterator(document, NodeFilter.SHOW_ALL, null, false);
|
||||
var expected = new Array(9, // document
|
||||
1, // html
|
||||
3, 1, // head
|
||||
3, 1, 3, // title
|
||||
3, 1, 3, 4, // script and CDATA block
|
||||
3, 3, 1, // body
|
||||
3, 1, 3, // pre
|
||||
3, // </body>
|
||||
3, 8, // <!-- -->
|
||||
3, 7, // <? ?>,
|
||||
3, 4, 3); // CDATA
|
||||
var found = new Array();
|
||||
|
||||
// walk document
|
||||
var node;
|
||||
while (node = iterator.nextNode())
|
||||
found.push(node.nodeType);
|
||||
|
||||
// check results
|
||||
var errors = 0;
|
||||
var s = '';
|
||||
var length = (found.length > expected.length) ? found.length : expected.length;
|
||||
s += 'EXPECTED FOUND\n';
|
||||
for (var i = 0; i < length; i += 1) {
|
||||
s += ' ' + (expected[i] ? expected[i] : '-') +
|
||||
' ' + (found[i] ? found[i] : '-');
|
||||
if (found[i] != expected[i]) {
|
||||
s += ' MISMATCH';
|
||||
errors += 1;
|
||||
}
|
||||
s += '\n';
|
||||
}
|
||||
var p = document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'pre')[0];
|
||||
if (errors)
|
||||
p.firstChild.data = 'FAIL: ' + errors + ' errors found:\n\n' + s;
|
||||
else
|
||||
p.firstChild.data = 'PASS';
|
||||
}
|
||||
]]></script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<pre id="result">FAIL: Script failed to run.</pre>
|
||||
</body>
|
||||
<!-- some more nodes to test this: -->
|
||||
<?test node?>
|
||||
<![CDATA[]]>
|
||||
</html>
|
||||
54
testing/web-platform/tests/dom/traversal/unfinished/002.xml
Normal file
54
testing/web-platform/tests/dom/traversal/unfinished/002.xml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Basics Backwards</title>
|
||||
<script type="text/javascript"> <![CDATA[
|
||||
function doTest() {
|
||||
var iterator = document.createNodeIterator(document, NodeFilter.SHOW_ALL, null, false);
|
||||
var expected = new Array(9, // document
|
||||
1, // html
|
||||
3, 1, // head
|
||||
3, 1, 3, // title
|
||||
3, 1, 3, 4, // script and CDATA block
|
||||
3, 3, 1, // body
|
||||
3, 1, 3, // pre
|
||||
3, // </body>
|
||||
3, 8, // <!-- -->
|
||||
3, 7, // <? ?>,
|
||||
3, 4, 3); // CDATA
|
||||
var found = new Array();
|
||||
|
||||
// walk document
|
||||
var node;
|
||||
while (node = iterator.nextNode());
|
||||
while (node = iterator.previousNode())
|
||||
found.unshift(node.nodeType);
|
||||
|
||||
// check results
|
||||
var errors = 0;
|
||||
var s = '';
|
||||
var length = (found.length > expected.length) ? found.length : expected.length;
|
||||
s += 'EXPECTED FOUND\n';
|
||||
for (var i = 0; i < length; i += 1) {
|
||||
s += ' ' + (expected[i] ? expected[i] : '-') +
|
||||
' ' + (found[i] ? found[i] : '-');
|
||||
if (found[i] != expected[i]) {
|
||||
s += ' MISMATCH';
|
||||
errors += 1;
|
||||
}
|
||||
s += '\n';
|
||||
}
|
||||
var p = document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'pre')[0];
|
||||
if (errors)
|
||||
p.firstChild.data = 'FAIL: ' + errors + ' errors found:\n\n' + s;
|
||||
else
|
||||
p.firstChild.data = 'PASS';
|
||||
}
|
||||
]]></script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<pre id="result">FAIL: Script failed to run.</pre>
|
||||
</body>
|
||||
<!-- some more nodes to test this: -->
|
||||
<?test node?>
|
||||
<![CDATA[]]>
|
||||
</html>
|
||||
58
testing/web-platform/tests/dom/traversal/unfinished/003.xml
Normal file
58
testing/web-platform/tests/dom/traversal/unfinished/003.xml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of nodes that should have no effect</title>
|
||||
<!--
|
||||
This tests these cases that should have no effect:
|
||||
1. Remove a node unrelated to the reference node
|
||||
2. Remove an ancestor of the root node
|
||||
3. Remove the root node itself
|
||||
4. Remove descendant of reference node
|
||||
-->
|
||||
<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 C = document.getElementById('C');
|
||||
var D = document.getElementById('D');
|
||||
var E = document.getElementById('E');
|
||||
check(iterator.nextNode(), root);
|
||||
remove(document.getElementById('X'));
|
||||
check(iterator.nextNode(), A);
|
||||
remove(document.getElementById('Y'));
|
||||
check(iterator.nextNode(), B);
|
||||
remove(root);
|
||||
check(iterator.nextNode(), C);
|
||||
remove(E);
|
||||
check(iterator.nextNode(), D);
|
||||
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="X"></span><span id="Y"><span id="root"><span id="A"><span id="B"><span id="C"><span id="D"><span id="E"></span></span></span></span></span></span></span></p>
|
||||
</body>
|
||||
</html>
|
||||
49
testing/web-platform/tests/dom/traversal/unfinished/004.xml
Normal file
49
testing/web-platform/tests/dom/traversal/unfinished/004.xml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of the Reference Node</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);
|
||||
check(iterator.previousNode(), AA);
|
||||
remove(AA);
|
||||
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 id="AA"></span></span><span id="B"></span><span id="C"><span id="CC"></span></span></span></p>
|
||||
</body>
|
||||
</html>
|
||||
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>
|
||||
47
testing/web-platform/tests/dom/traversal/unfinished/006.xml
Normal file
47
testing/web-platform/tests/dom/traversal/unfinished/006.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (forwards)</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);
|
||||
remove(B);
|
||||
check(iterator.previousNode(), A);
|
||||
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>
|
||||
54
testing/web-platform/tests/dom/traversal/unfinished/007.xml
Normal file
54
testing/web-platform/tests/dom/traversal/unfinished/007.xml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (forwards) (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 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);
|
||||
remove(B);
|
||||
var X = addChildTo(A);
|
||||
check(iterator.nextNode(), X);
|
||||
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');
|
||||
x.id = 'X';
|
||||
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><span id="B"><span id="BB"></span></span><span id="C"></span></span></p>
|
||||
</body>
|
||||
</html>
|
||||
48
testing/web-platform/tests/dom/traversal/unfinished/008.xml
Normal file
48
testing/web-platform/tests/dom/traversal/unfinished/008.xml
Normal file
|
|
@ -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>
|
||||
55
testing/web-platform/tests/dom/traversal/unfinished/009.xml
Normal file
55
testing/web-platform/tests/dom/traversal/unfinished/009.xml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (backwards) (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 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);
|
||||
var X = addChildTo(A);
|
||||
check(iterator.previousNode(), X);
|
||||
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');
|
||||
x.id = 'X';
|
||||
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><span id="B"><span id="BB"></span></span><span id="C"></span></span></p>
|
||||
</body>
|
||||
</html>
|
||||
64
testing/web-platform/tests/dom/traversal/unfinished/010.xml
Normal file
64
testing/web-platform/tests/dom/traversal/unfinished/010.xml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>DOM Traversal: NodeIterator: Filters</title>
|
||||
<script type="text/javascript"> <![CDATA[
|
||||
function doTest() {
|
||||
var iterator = document.createNodeIterator(document, NodeFilter.SHOW_ALL, testFilter, false);
|
||||
// skips text nodes and body element
|
||||
var expected = new Array(9, // document
|
||||
1, // html
|
||||
1, // head
|
||||
1, // title
|
||||
1, 4, // script and CDATA block
|
||||
// body (skipped)
|
||||
1, // pre
|
||||
// </body>
|
||||
8, // <!-- -->
|
||||
// PI skipped
|
||||
4); // CDATA
|
||||
var found = new Array();
|
||||
|
||||
// walk document
|
||||
var node;
|
||||
while (node = iterator.nextNode())
|
||||
found.push(node.nodeType);
|
||||
|
||||
// check results
|
||||
var errors = 0;
|
||||
var s = '';
|
||||
var length = (found.length > expected.length) ? found.length : expected.length;
|
||||
s += 'EXPECTED FOUND\n';
|
||||
for (var i = 0; i < length; i += 1) {
|
||||
s += ' ' + (expected[i] ? expected[i] : '-') +
|
||||
' ' + (found[i] ? found[i] : '-');
|
||||
if (found[i] != expected[i]) {
|
||||
s += ' MISMATCH';
|
||||
errors += 1;
|
||||
}
|
||||
s += '\n';
|
||||
}
|
||||
var p = document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'pre')[0];
|
||||
if (errors)
|
||||
p.firstChild.data = 'FAIL: ' + errors + ' errors found:\n\n' + s;
|
||||
else
|
||||
p.firstChild.data = 'PASS';
|
||||
}
|
||||
|
||||
function testFilter(n) {
|
||||
if (n.nodeType == 3) {
|
||||
return NodeFilter.FILTER_SKIP;
|
||||
} else if (n.nodeName == 'body') {
|
||||
return NodeFilter.FILTER_REJECT; // same as _SKIP
|
||||
}
|
||||
return 1; // FILTER_ACCEPT
|
||||
}
|
||||
|
||||
]]></script>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<pre id="result">FAIL: Script failed to run.</pre>
|
||||
</body>
|
||||
<!-- some more nodes to test this: -->
|
||||
<?body test?>
|
||||
<![CDATA[]]>
|
||||
</html>
|
||||
1
testing/web-platform/tests/dom/traversal/unfinished/TODO
Normal file
1
testing/web-platform/tests/dom/traversal/unfinished/TODO
Normal file
|
|
@ -0,0 +1 @@
|
|||
Check what happens when a NodeFilter turns a number not in the range 1..3
|
||||
Loading…
Add table
Add a link
Reference in a new issue