summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
blob: 40eccd3de37b7f1352f1f194722272f6d10d18b7 (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
<!DOCTYPE html>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>

function newXMLDocument() {
  return document.implementation.createDocument(null, "foo", null);
}

test(function() {
  var doc = newXMLDocument();
  assert_equals(doc.title, "");
  doc.title = "fail";
  assert_equals(doc.title, "");
}, "Should not be able to set document title in XML document");

test(function() {
  var doc = newXMLDocument();
  doc.documentElement.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html:title"));
  assert_equals(doc.title, "");
  doc.title = "fail";
  assert_equals(doc.title, "");
}, "Should not be able to set document title in XML document with html:title element");
</script>