File: the-input-byte-stream-004.html

package info (click to toggle)
firefox-esr 140.4.0esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,539,276 kB
  • sloc: cpp: 7,381,286; javascript: 6,388,710; ansic: 3,710,139; python: 1,393,780; xml: 628,165; asm: 426,918; java: 184,004; sh: 65,742; makefile: 19,302; objc: 13,059; perl: 12,912; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,226; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (66 lines) | stat: -rw-r--r-- 2,624 bytes parent folder | download | duplicates (29)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>

<html  lang="en" >

<head>

<title>UTF-16BE BOM</title>

<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>

<link rel='help' href='https://html.spec.whatwg.org/multipage/#the-input-byte-stream'>

<script src="/resources/testharness.js"></script>

<script src="/resources/testharnessreport.js"></script>

<meta name='flags' content='http'>

<style type='text/css'>

.test div { width: 50px; }

</style>



<link rel="stylesheet" type="text/css" href="support/encodingtests-15.css">

</head>

<body>



<div class='test'><div id='box' class='S a'>&#xA0;</div></div>



<!-- Notes: 

No encoding information is declared in the HTTP header or inside the document, other than in the BOM. The text of a class name in the test contains the following sequence of bytes: 0x00 0xC3  0x01 0x53  0x00 0xC3  0x20 0xAC  0x00 0xC3  0x01 0x61. The external, UTF-8-encoded stylesheet contains a selector with a sequence of characters that will only match the class name in the HTML if the page is read as UTF-16BE.

-->



<script>

test(function () {

    assert_equals(document.getElementById('box').offsetWidth, 100);

	}, 'A page with no encoding declarations, but with a UTF-16 big-endian BOM will be recognized as UTF-16.');

</script>



<div id="log"></div>



</body>

</html>