OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../js/resources/js-test-pre.js"></script> | 3 <script src="../js/resources/js-test-pre.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <script> | 6 <script> |
7 var dt = document.implementation.createDocumentType("foo", "", ""); | 7 var dt = document.implementation.createDocumentType("foo", "", ""); |
8 var iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); | 8 var iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); |
9 debug("NodeIterator rooted at a DocumentType node not yet associated with a docu
ment:"); | 9 debug("NodeIterator rooted at a DocumentType node not yet associated with a docu
ment:"); |
10 shouldBe('iter.referenceNode.ownerDocument', 'null'); | 10 shouldBe('iter.referenceNode.ownerDocument', 'document'); |
11 shouldBe('iter.nextNode()', 'dt'); | 11 shouldBe('iter.nextNode()', 'dt'); |
12 shouldBe('iter.nextNode()', 'null'); | 12 shouldBe('iter.nextNode()', 'null'); |
13 shouldBe('iter.previousNode()', 'dt'); | 13 shouldBe('iter.previousNode()', 'dt'); |
14 shouldBe('iter.previousNode()', 'null'); | 14 shouldBe('iter.previousNode()', 'null'); |
15 iter.detach(); | 15 iter.detach(); |
16 | 16 |
17 iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); | 17 iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); |
18 var d = document.implementation.createDocument(null, "doc", dt); | 18 var d = document.implementation.createDocument(null, "doc", dt); |
19 debug("\nNodeIterator rooted at a DocumentType node that becomes used by a docum
ent after the iterator has been created:"); | 19 debug("\nNodeIterator rooted at a DocumentType node that becomes used by a docum
ent after the iterator has been created:"); |
20 shouldBe('iter.nextNode()', 'dt'); | 20 shouldBe('iter.nextNode()', 'dt'); |
21 shouldBe('iter.previousNode()', 'dt'); | 21 shouldBe('iter.previousNode()', 'dt'); |
22 debug("..and after removing it from the document:"); | 22 debug("..and after removing it from the document:"); |
23 d.removeChild(dt); | 23 d.removeChild(dt); |
24 shouldBe('iter.nextNode()', 'dt'); | 24 shouldBe('iter.nextNode()', 'dt'); |
25 shouldBe('iter.previousNode()', 'dt'); | 25 shouldBe('iter.previousNode()', 'dt'); |
26 iter.detach(); | 26 iter.detach(); |
27 </script> | 27 </script> |
28 <script src="../js/resources/js-test-post.js"></script> | 28 <script src="../js/resources/js-test-post.js"></script> |
29 </body> | 29 </body> |
30 </html> | 30 </html> |
OLD | NEW |