OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <body> |
| 3 <script src="../../js/resources/js-test-pre.js"></script> |
| 4 <script> |
| 5 |
| 6 description('This tests that Document implements the ParentNode interface.'); |
| 7 |
| 8 var doc = document.implementation.createDocument('', null, null); |
| 9 |
| 10 shouldBe('doc.children.length', '0'); |
| 11 shouldBe('doc.childElementCount', '0'); |
| 12 shouldBeNull('doc.firstElementChild'); |
| 13 shouldBeNull('doc.lastElementChild'); |
| 14 |
| 15 doc.appendChild(new Comment('a')); |
| 16 shouldBe('doc.children.length', '0'); |
| 17 shouldBe('doc.childElementCount', '0'); |
| 18 shouldBeNull('doc.firstElementChild'); |
| 19 shouldBeNull('doc.lastElementChild'); |
| 20 |
| 21 var b = doc.appendChild(doc.createElement('b')); |
| 22 shouldBe('doc.children.length', '1'); |
| 23 shouldBe('doc.childElementCount', '1'); |
| 24 shouldBe('doc.children[0]', 'b'); |
| 25 shouldBe('doc.firstElementChild', 'b'); |
| 26 shouldBe('doc.lastElementChild', 'b'); |
| 27 |
| 28 doc.appendChild(new Comment('c')); |
| 29 shouldBe('doc.children.length', '1'); |
| 30 shouldBe('doc.childElementCount', '1'); |
| 31 shouldBe('doc.children[0]', 'b'); |
| 32 shouldBe('doc.firstElementChild', 'b'); |
| 33 shouldBe('doc.lastElementChild', 'b'); |
| 34 |
| 35 </script> |
| 36 <script src="../../js/resources/js-test-post.js"></script> |
OLD | NEW |