Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / NodeList / nodelist-namespace-invalidation.html
blob72c05e927f1d80f9717be4373cc628001349520c
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
7 description("This tests that node lists returned by getElementsByTagNameNS are invalidated upon child node changes.");
9 var container = document.createElement('div');
11 function appendImageWithId(id) {
12 container.appendChild(document.createElement('img'));
13 container.lastChild.id = id;
16 var nodeList;
17 var namespace = document.body.namespaceURI;
18 shouldBe("appendImageWithId('firstImage'); nodeList = container.getElementsByTagNameNS(namespace, 'img'); nodeList.item(0).id", "'firstImage'");
19 shouldBe("nodeList.length", "1");
20 shouldBe("appendImageWithId('secondImage'); container.removeChild(container.firstChild); nodeList.item(0).id", "'secondImage'");
21 shouldBe("nodeList.length", "1");
23 </script>
24 </body>
25 </html>