Reviewed by me
[WebKit-https.git] / LayoutTests / traversal / node-iterator-008.html
1 <html> 
2 <head>
3 <script src=traversal.js language="JavaScript" type="text/JavaScript" ></script>
4 <title>Traversal Test</title> 
5 </head> 
6 <body>
7 <div id="test">
8 <span id="A"></span><span id="B"></span><span id="C"><span id="D"  marked="YES"></span><span id="E"></span><span id="F"></span></span><span id="G"></span><span id="H"></span><span id="I"></span>
9 </div>
10 <div style="font-family: Courier; font-size: 14;">
11 <script>
12 var parent = document.getElementById('test');
13 //var root = document.getElementById('A');
14 var root = document;
15
16 function testNodeFiter(n)
17 {
18     if (n.getAttribute('marked') == 'YES') return NodeFilter.FILTER_ACCEPT;
19     return NodeFilter.FILTER_SKIP;
20 }
21
22 var it = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, testNodeFiter, false);
23 var out = '';
24 while ((n = it.nextNode())) {
25     out += "<br>" + n.tagName + ": " + n.id;
26 }
27 document.write(out);
28
29 </script>
30 </div>
31 </body>
32 </html>