Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / node-iterator-reference-node-removed.html
blob0c5fbfc8a7f2f1d1ec90a0f9a05fe1c40b819ed7
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <div id="testDiv" style="display:none;">
4 <div id="div1">aaa</div>
5 <div id="div2">bbb</div>
6 </div>
7 <script>
8 description("This test removes the NodeItertor's current reference node, then continues to move through the document.");
10 var testDiv = document.getElementById("testDiv");
11 var div1 = document.getElementById("div1");
12 var div2 = document.getElementById("div2");
13 var iter = document.createNodeIterator(testDiv, NodeFilter.SHOW_ELEMENT, null, false);
15 shouldBe("iter.nextNode()", "testDiv");
16 shouldBe("iter.nextNode()", "div1");
17 shouldBe("iter.nextNode()", "div2");
18 shouldBe("iter.nextNode()", "null");
19 shouldBe("iter.previousNode()", "div2");
20 shouldBe("iter.previousNode()", "div1");
21 testDiv.removeChild(div1);
22 shouldBe("iter.nextNode()", "div2");
23 </script>