testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.title-03.html
author Bogdan Szekely <bszekely@mozilla.com>
Tue, 24 May 2022 12:30:06 +0300
changeset 618582 a8d14b4525477eee3cd5bd65a93751e2d1be60f4
parent 292674 0cd33f35bcb4feea6fcdfbc0f6f09912e2ad106c
permissions -rw-r--r--
Merge autoland to mozilla-central. a=merge

<!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>