3 <script src=
"../../../resources/js-test.js"></script>
6 description('This tests that Document implements the ParentNode interface.');
8 var doc
= document
.implementation
.createDocument('', null, null);
10 shouldBe('doc.children.length', '0');
11 shouldBe('doc.childElementCount', '0');
12 shouldBeNull('doc.firstElementChild');
13 shouldBeNull('doc.lastElementChild');
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');
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');
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');