document.title-03.html (1220B)
1 <!DOCTYPE html> 2 <title> document.title and space normalization </title> 3 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#document.title"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <div id="log"></div> 8 <script> 9 function test_title(set, expected) { 10 test(function() { 11 document.title = set; 12 assert_equals(document.title, expected); 13 }, "document.title after setting to " + format_value(set)); 14 } 15 16 test(function() { 17 // Single space characters must be normalized. (WHATWG r4353) 18 assert_equals(document.title, "document.title and space normalization"); 19 }, "document.title initial value"); 20 21 test_title("one space", "one space"); 22 test_title("two spaces", "two spaces"); 23 test_title("one\ttab", "one tab"); 24 test_title("two\t\ttabs", "two tabs"); 25 test_title("one\nnewline", "one newline"); 26 test_title("two\n\nnewlines", "two newlines"); 27 test_title("one\fform feed", "one form feed"); 28 test_title("two\f\fform feeds", "two form feeds"); 29 test_title("one\rcarriage return", "one carriage return"); 30 test_title("two\r\rcarriage returns", "two carriage returns"); 31 </script>