blob: 77b90bf7e98cb9c83d5bf0c6ec99e0d43cd39caf [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test-pre.js"></script>
<div id="testDiv" style="display:none;">
<div id="div1">aaa</div>
<div id="div2">bbb</div>
</div>
<script>
description("This test removes the NodeItertor's current reference node, then continues to move through the document.");
var testDiv = document.getElementById("testDiv");
var div1 = document.getElementById("div1");
var div2 = document.getElementById("div2");
var iter = document.createNodeIterator(testDiv, NodeFilter.SHOW_ELEMENT, null, false);
shouldBe("iter.nextNode()", "testDiv");
shouldBe("iter.nextNode()", "div1");
shouldBe("iter.nextNode()", "div2");
shouldBe("iter.nextNode()", "null");
shouldBe("iter.previousNode()", "div2");
shouldBe("iter.previousNode()", "div1");
testDiv.removeChild(div1);
shouldBe("iter.nextNode()", "div2");
</script>
<script src="../../resources/js-test-post.js"></script>