3 <script src=traversal.js
language=
"JavaScript" type=
"text/JavaScript" ></script>
4 <title>Traversal Test
</title>
47 <div style=
"font-family: Courier; font-size: 14; white-space: pre">
49 if (window
.testRunner
)
50 testRunner
.dumpAsText();
52 var root
= document
.getElementById('test');
53 var start
= document
.getElementById('A');
55 function testNodeFiter(n
)
57 if (n
.tagName
== 'SPAN') {
58 if (n
.id
== 'B.1' || n
.id
== 'C.1.1')
59 return NodeFilter
.FILTER_REJECT
;
60 return NodeFilter
.FILTER_ACCEPT
;
62 return NodeFilter
.FILTER_SKIP
;
65 var tw1
= document
.createTreeWalker(root
, NodeFilter
.SHOW_ELEMENT
, testNodeFiter
, false);
66 document
.write(dumpTreeWalker(tw1
, start
));
68 var tw2
= document
.createTreeWalker(root
, NodeFilter
.SHOW_ELEMENT
, testNodeFiter
, false);
69 document
.write(dumpTreeWalker(tw2
, start
, document
.getElementById('D'), true));