4 <script src=
"../../../resources/js-test.js"></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
;
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");