Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / traversal / node-iterator-006.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"><span id="A"></span><span id="B"></span><span id="C"></span></div>
8 <div style="font-family: Courier; font-size: 14;">
9 <script>
10 if (window.testRunner)
11     testRunner.dumpAsText();
12
13 var root = document.getElementById('test');
14
15 function testNodeFiter(n)
16 {
17     if (n.tagName == 'SPAN') return NodeFilter.FILTER_ACCEPT;
18     return NodeFilter.FILTER_SKIP;
19 }
20
21 var it = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, testNodeFiter, false);
22 for (i = 0; i < 3; i++)
23     it.nextNode();
24  it.previousNode();
25 document.write(dumpNodeIterator(it, "ref node 'C'; pointer before"));
26
27 // remove node 'C'
28 document.write("<p>remove node 'C'");
29 var D = document.getElementById('C');
30 root.removeChild(D);
31 document.write(dumpNodeIterator(it, "ref node 'B'; pointer after"));
32 </script>
33 </div>
34 </body>
35 </html>