| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <title>document.implementation.createDocument with current document's DOCTYPE</t
itle> | 2 <html> |
| 3 <head> |
| 4 <script src="../../../js/resources/js-test-pre.js"></script> |
| 5 </head> |
| 3 <body> | 6 <body> |
| 4 FAIL (Script did not run); | |
| 5 <script> | 7 <script> |
| 6 document.body.textContent = "FAIL"; | 8 description("document.implementation.createDocument with current document's DOCT
YPE.") |
| 7 try { | 9 |
| 8 document.implementation.createDocument(null, null, document.doctype); | 10 var doctype = document.doctype; |
| 9 document.body.textContent = "FAIL (no exception)"; | 11 var doc; |
| 10 } | 12 shouldNotThrow("doc = document.implementation.createDocument(null, null, documen
t.doctype)"); |
| 11 catch(e) { | 13 shouldBe('doc.doctype', 'doctype'); |
| 12 if (e.code === DOMException.WRONG_DOCUMENT_ERR || e.code === DOMException.NO
T_SUPPORTED_ERR) | 14 shouldBe('doc.firstChild', 'doctype'); |
| 13 document.body.textContent = "PASS"; | 15 shouldBe('document.doctype', 'null'); |
| 14 else | |
| 15 document.body.textContent = "FAIL (wrong exception: " + e.code + ")"; | |
| 16 } | |
| 17 </script> | 16 </script> |
| 17 </body> |
| 18 </html> |
| OLD | NEW |