summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html
blob: 952c29db5f561c3980284a307a144e87d41e976c (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
<!DOCTYPE html>
<title> document.title  and space normalization  </title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.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 test_title(set, expected) {
  test(function() {
      document.title = set;
      assert_equals(document.title, expected);
  }, "document.title after setting to " + format_value(set));
}

test(function() {
  // Single space characters must be normalized. (WHATWG r4353)
  assert_equals(document.title, "document.title and space normalization");
}, "document.title initial value");

test_title("one space", "one space");
test_title("two  spaces", "two spaces");
test_title("one\ttab", "one tab");
test_title("two\t\ttabs", "two tabs");
test_title("one\nnewline", "one newline");
test_title("two\n\nnewlines", "two newlines");
test_title("one\fform feed", "one form feed");
test_title("two\f\fform feeds", "two form feeds");
test_title("one\rcarriage return", "one carriage return");
test_title("two\r\rcarriage returns", "two carriage returns");
</script>