summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-08.html
blob: a643b75f4e90bfa56c2ac4f4ea024261d55fc6b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
<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>
test(function() {
  assert_equals(document.title, "");
}, "No title element");

test(function() {
  var title = document.createElement("title");
  title.appendChild(document.createTextNode("PASS"));
  document.head.appendChild(title);
  assert_equals(document.title, "PASS");

  title.appendChild(document.createTextNode("PASS2"));
  title.appendChild(document.createTextNode("PASS3"));
  assert_equals(document.title, "PASSPASS2PASS3");
}, "title element contains multiple child text nodes");
</script>