| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>DOMImplementation.createDocument(namespace, qualifiedName, doctype)</titl
e> | 3 <title>DOMImplementation.createDocument(namespace, qualifiedName, doctype)</titl
e> |
| 4 <link rel=help href="https://dom.spec.whatwg.org/#dom-domimplementation-createdo
cument"> | 4 <link rel=help href="https://dom.spec.whatwg.org/#dom-domimplementation-createdo
cument"> |
| 5 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelementns"> | 5 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelementns"> |
| 6 <link rel=help href="https://dom.spec.whatwg.org/#dom-node-nodetype"> | 6 <link rel=help href="https://dom.spec.whatwg.org/#dom-node-nodetype"> |
| 7 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-documentelement"> | 7 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-documentelement"> |
| 8 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-doctype"> | 8 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-doctype"> |
| 9 <script src="/resources/testharness.js"></script> | 9 <script src="/resources/testharness.js"></script> |
| 10 <script src="/resources/testharnessreport.js"></script> | 10 <script src="/resources/testharnessreport.js"></script> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 test(function() { | 133 test(function() { |
| 134 var doc = document.implementation.createDocument(namespace, qualifiedNam
e, doctype) | 134 var doc = document.implementation.createDocument(namespace, qualifiedNam
e, doctype) |
| 135 assert_equals(doc.compatMode, "CSS1Compat") | 135 assert_equals(doc.compatMode, "CSS1Compat") |
| 136 assert_equals(doc.characterSet, "UTF-8") | 136 assert_equals(doc.characterSet, "UTF-8") |
| 137 assert_equals(doc.contentType, namespace == htmlNamespace ? "application
/xhtml+xml" | 137 assert_equals(doc.contentType, namespace == htmlNamespace ? "application
/xhtml+xml" |
| 138 : namespace == svgNamespace ? "image/svg+xml" | 138 : namespace == svgNamespace ? "image/svg+xml" |
| 139 : "application/xml") | 139 : "application/xml") |
| 140 assert_equals(doc.URL, "about:blank") | 140 assert_equals(doc.URL, "about:blank") |
| 141 assert_equals(doc.documentURI, "about:blank") | 141 assert_equals(doc.documentURI, "about:blank") |
| 142 assert_equals(doc.createElement("DIV").localName, "DIV"); | 142 assert_equals(doc.createElement("DIV").localName, "DIV"); |
| 143 }, "createDocument test " + i + ": metadata for " + | 143 }, "createDocument test: metadata for " + |
| 144 [namespace, qualifiedName, doctype].map(my_format_value)) | 144 [namespace, qualifiedName, doctype].map(my_format_value)) |
| 145 | 145 |
| 146 test(function() { | 146 test(function() { |
| 147 var doc = document.implementation.createDocument(namespace, qualifiedNam
e, doctype) | 147 var doc = document.implementation.createDocument(namespace, qualifiedNam
e, doctype) |
| 148 assert_equals(doc.characterSet, "UTF-8", "characterSet"); | 148 assert_equals(doc.characterSet, "UTF-8", "characterSet"); |
| 149 assert_equals(doc.charset, "UTF-8", "charset"); | 149 assert_equals(doc.charset, "UTF-8", "charset"); |
| 150 assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding"); | 150 assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding"); |
| 151 }, "createDocument test " + i + ": characterSet aliases for " + | 151 }, "createDocument test: characterSet aliases for " + |
| 152 [namespace, qualifiedName, doctype].map(my_format_value)) | 152 [namespace, qualifiedName, doctype].map(my_format_value)) |
| 153 } | 153 } |
| 154 }) | 154 }) |
| 155 }) | 155 }) |
| 156 | 156 |
| 157 test(function() { | 157 test(function() { |
| 158 assert_throws(new TypeError(), function() { | 158 assert_throws(new TypeError(), function() { |
| 159 document.implementation.createDocument() | 159 document.implementation.createDocument() |
| 160 }, "createDocument() should throw") | 160 }, "createDocument() should throw") |
| 161 | 161 |
| 162 assert_throws(new TypeError(), function() { | 162 assert_throws(new TypeError(), function() { |
| 163 document.implementation.createDocument('') | 163 document.implementation.createDocument('') |
| 164 }, "createDocument('') should throw") | 164 }, "createDocument('') should throw") |
| 165 }, "createDocument with missing arguments"); | 165 }, "createDocument with missing arguments"); |
| 166 </script> | 166 </script> |
| OLD | NEW |