blob: c77b2638f35fd5c5007786a8217525011643902b [file] [log] [blame]
<html>
<head>
<script src=traversal.js language="JavaScript" type="text/JavaScript" ></script>
<title>Traversal Test</title>
</head>
<body>
<div id="test">
<span id="A"></span><span id="B"></span><span id="C"></span><span id="D"></span><span id="E"></span><span id="F"></span><span id="G"></span><span id="H"></span><span id="I"></span>
</div>
<div style="font-family: Courier; font-size: 14;">
<script>
if (window.testRunner)
testRunner.dumpAsText();
var root = document.getElementById('test');
function testNodeFiter(n)
{
if (n.tagName == 'SPAN') return NodeFilter.FILTER_ACCEPT;
return NodeFilter.FILTER_SKIP;
}
var it = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, testNodeFiter, false);
document.write(dumpNodeIterator(it, "ref node root; pointer after"));
it.nextNode();
document.write(dumpNodeIterator(it, "ref node 'A'; pointer after"));
it.previousNode();
document.write(dumpNodeIterator(it, "ref node 'A'; pointer before"));
it.previousNode();
document.write(dumpNodeIterator(it, "ref node 'A'; pointer before"));
</script>
</div>
</body>
</html>