| <!doctype html> |
| <title>document.implementation.createDocument with current document's DOCTYPE</title> |
| <body> |
| FAIL (Script did not run); |
| <script> |
| document.body.textContent = "FAIL"; |
| try { |
| document.implementation.createDocument(null, null, document.doctype); |
| document.body.textContent = "FAIL (no exception)"; |
| } |
| catch(e) { |
| if (e.code === DOMException.WRONG_DOCUMENT_ERR || e.code === DOMException.NOT_SUPPORTED_ERR) |
| document.body.textContent = "PASS"; |
| else |
| document.body.textContent = "FAIL (wrong exception: " + e.code + ")"; |
| } |
| </script> |