blob: d4c5b3fe5b93b2145e6f1a0ad6b43ac4a6a6d0e3 [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>
</div>
<div style="font-family: Courier; font-size: 14;">
<script>
if (window.layoutTestController)
layoutTestController.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);
for (i = 0; i < 3; i++)
it.nextNode();
it.previousNode();
document.write(dumpNodeIterator(it, "ref node 'C'; pointer before"));
// remove node 'C'
document.write("<p>remove node 'C'");
var D = document.getElementById('C');
root.removeChild(D);
document.write(dumpNodeIterator(it, "ref node 'B'; pointer after"));
</script>
</div>
</body>
</html>