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 return NodeFilter
.FILTER_ACCEPT
;
59 return NodeFilter
.FILTER_SKIP
;
62 var tw1
= document
.createTreeWalker(root
, NodeFilter
.SHOW_ELEMENT
, testNodeFiter
, false);
63 document
.write(dumpTreeWalker(tw1
, start
));
65 var tw2
= document
.createTreeWalker(root
, NodeFilter
.SHOW_ELEMENT
, testNodeFiter
, false);
66 document
.write(dumpTreeWalker(tw2
, start
, document
.getElementById('D'), true));