summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/Document-constructor.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/dom/nodes/Document-constructor.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/Document-constructor.html')
-rw-r--r--testing/web-platform/tests/dom/nodes/Document-constructor.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/Document-constructor.html b/testing/web-platform/tests/dom/nodes/Document-constructor.html
new file mode 100644
index 000000000..11549da4a
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-constructor.html
@@ -0,0 +1,53 @@
+<!doctype html>
+<meta charset=windows-1252>
+<!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8
+ from the parent document. -->
+<title>Document constructor</title>
+<link rel=help href="https://dom.spec.whatwg.org/#dom-document">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var doc = new Document();
+ assert_true(doc instanceof Node, "Should be a Node");
+ assert_true(doc instanceof Document, "Should be a Document");
+ assert_false(doc instanceof XMLDocument, "Should not be an XMLDocument");
+ assert_equals(Object.getPrototypeOf(doc), Document.prototype,
+ "Document should be the primary interface");
+}, "new Document(): interfaces")
+
+test(function() {
+ var doc = new Document();
+ assert_equals(doc.firstChild, null, "firstChild");
+ assert_equals(doc.lastChild, null, "lastChild");
+ assert_equals(doc.doctype, null, "doctype");
+ assert_equals(doc.documentElement, null, "documentElement");
+ assert_array_equals(doc.childNodes, [], "childNodes");
+}, "new Document(): children")
+
+test(function() {
+ var doc = new Document();
+ assert_equals(doc.URL, "about:blank");
+ assert_equals(doc.documentURI, "about:blank");
+ assert_equals(doc.compatMode, "CSS1Compat");
+ assert_equals(doc.characterSet, "UTF-8");
+ assert_equals(doc.contentType, "application/xml");
+ assert_equals(doc.createElement("DIV").localName, "DIV");
+}, "new Document(): metadata")
+
+test(function() {
+ var doc = new Document();
+ assert_equals(doc.characterSet, "UTF-8", "characterSet");
+ assert_equals(doc.charset, "UTF-8", "charset");
+ assert_equals(doc.inputEncoding, "UTF-8", "inputEncoding");
+}, "new Document(): characterSet aliases")
+
+test(function() {
+ var doc = new Document();
+ var a = doc.createElement("a");
+ // In UTF-8: 0xC3 0xA4
+ a.href = "http://example.org/?\u00E4";
+ assert_equals(a.href, "http://example.org/?%C3%A4");
+}, "new Document(): URL parsing")
+</script>