| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 description("This tests that node lists returned by getElementsByTagNameNS are i
nvalidated upon child node changes."); | 7 description("This tests that node lists returned by getElementsByTagNameNS are i
nvalidated upon child node changes."); |
| 8 | 8 |
| 9 var container = document.createElement('div'); | 9 var container = document.createElement('div'); |
| 10 | 10 |
| 11 function appendImageWithId(id) { | 11 function appendImageWithId(id) { |
| 12 container.appendChild(document.createElement('img')); | 12 container.appendChild(document.createElement('img')); |
| 13 container.lastChild.id = id; | 13 container.lastChild.id = id; |
| 14 } | 14 } |
| 15 | 15 |
| 16 var nodeList; | 16 var nodeList; |
| 17 var namespace = document.body.namespaceURI; | 17 var namespace = document.body.namespaceURI; |
| 18 shouldBe("appendImageWithId('firstImage'); nodeList = container.getElementsByTag
NameNS(namespace, 'img'); nodeList.item(0).id", "'firstImage'"); | 18 shouldBe("appendImageWithId('firstImage'); nodeList = container.getElementsByTag
NameNS(namespace, 'img'); nodeList.item(0).id", "'firstImage'"); |
| 19 shouldBe("nodeList.length", "1"); | 19 shouldBe("nodeList.length", "1"); |
| 20 shouldBe("appendImageWithId('secondImage'); container.removeChild(container.firs
tChild); nodeList.item(0).id", "'secondImage'"); | 20 shouldBe("appendImageWithId('secondImage'); container.removeChild(container.firs
tChild); nodeList.item(0).id", "'secondImage'"); |
| 21 shouldBe("nodeList.length", "1"); | 21 shouldBe("nodeList.length", "1"); |
| 22 | 22 |
| 23 </script> | 23 </script> |
| 24 </body> | 24 </body> |
| 25 </html> | 25 </html> |
| OLD | NEW |