4 Test adapted from http://mxr.mozilla.org/mozilla-central/source/content/base/test/test_bug559526.html
6 https://bugzilla.mozilla.org/show_bug.cgi?id=559526
9 <title>Test for Bug
559526</title>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=559526">Mozilla Bug
559526</a>
14 <div id=
"content" style=
"display: none">
18 <div id=
"nodes" style=
"display:none">
19 <div id=
"child1"></div>
20 <div id=
"child2"></div>
22 <div id=
"child3"></div>
23 <div id=
"child4"></div>
24 <div id=
"child5"></div>
25 <div id=
"child6"></div>
26 <div id=
"child7"></div>
27 <div id=
"child8"></div>
29 <script type=
"application/javascript">
31 if (window.testRunner)
32 testRunner.dumpAsText();
34 /** Test for Bug
559526 **/
39 function filter(node) {
40 if (node.id ==
"child3" && ! recurse) {
44 var foo = it.nextNode();
49 console.log(
"Should have thrown an exception: " + ex);
52 return NodeFilter.FILTER_ACCEPT;
55 (function testNodeIterator() {
57 it = document.createNodeIterator(
58 document.getElementById(
"nodes"),
59 NodeFilter.SHOW_ELEMENT,
63 while (it.nextNode());
66 (function testTreeWalker() {
67 it = document.createTreeWalker(
68 document.getElementById(
"nodes"),
69 NodeFilter.SHOW_ELEMENT,
75 it = document.createTreeWalker(
76 document.getElementById(
"nodes"),
77 NodeFilter.SHOW_ELEMENT,
82 while(it.nextSibling());
84 it = document.createTreeWalker(
85 document.getElementById(
"nodes"),
86 NodeFilter.SHOW_ELEMENT,
91 while(it.previousSibling());
94 console.log(
"Should have tests 4 filter calls: " + testCount);