summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/Document-constructor-svg.svg
blob: 77e3d8996e6bbc71bd1521903115b34302e23d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="windows-1252"?>
<!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8
     from the parent document. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml"
  width="100%" height="100%" viewBox="0 0 800 600">
<title>Document constructor</title>
<html:script src="/resources/testharness.js"></html:script>
<html:script src="/resources/testharnessreport.js"></html:script>
<html: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")
]]></html:script>
</svg>