summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml')
-rw-r--r--testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml b/testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml
new file mode 100644
index 0000000000..c9fc775806
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-constructor-xml.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8
+ from the parent document. -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Document constructor</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#dom-document" />
+</head>
+<body>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script><![CDATA[
+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")
+]]></script>
+</body>
+</html>