OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>DocumentType.cloneNode()</title> |
| 3 <link rel="help" href="http://dom.spec.whatwg.org/#dom-node-clonenode"> |
| 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script> |
| 6 description('Tests cloneNode for DocumentType.'); |
| 7 |
| 8 shouldBeNonNull("document.doctype"); |
| 9 shouldBe("document.doctype.parentNode", "document"); |
| 10 |
| 11 var cd = document.doctype.cloneNode(false); |
| 12 shouldBeNonNull("cd"); |
| 13 shouldBe("cd.publicId", "document.doctype.publicId"); |
| 14 shouldBe("cd.systemId", "document.doctype.systemId"); |
| 15 shouldBe("cd.parentNode", "null"); |
| 16 shouldBe("cd.ownerDocument", "document"); |
| 17 |
| 18 var doc = document.implementation.createDocument(null, null, null); |
| 19 cd = doc.importNode(cd, true); |
| 20 |
| 21 shouldBe("cd.publicId", "document.doctype.publicId"); |
| 22 shouldBe("cd.systemId", "document.doctype.systemId"); |
| 23 shouldBe("cd.parentNode", "null"); |
| 24 shouldBe("cd.ownerDocument", "doc"); |
| 25 doc.appendChild(cd); |
| 26 shouldBe("cd.parentNode", "doc"); |
| 27 |
| 28 var cd = document.implementation.createDocumentType( |
| 29 "a", "b", "c").cloneNode(false); |
| 30 shouldBe("cd.name", "'a'"); |
| 31 shouldBe("cd.publicId", "'b'"); |
| 32 shouldBe("cd.systemId", "'c'"); |
| 33 shouldBe("cd.parentNode", "null"); |
| 34 shouldBe("cd.ownerDocument", "document"); |
| 35 |
| 36 </script> |
OLD | NEW |