Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / test / test_bug437915.html
blobfb6830dd57c6276ca3fdd619454f9152c0ef3644
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=437915
5 -->
6 <head>
7 <title>Test for Bug 437915</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 <style type="text/css">
12 div.classvalue { text-decoration: underline; }
13 div[title~="titlevalue"] { visibility: hidden; }
15 </style>
16 </head>
17 <body>
18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437915">Mozilla Bug 437915</a>
19 <p id="display"></p>
20 <div id="content" style="display: none">
22 </div>
23 <pre id="test">
24 <script class="testbody" type="text/javascript">
26 /** Test for Bug 437915 **/
28 var div = document.getElementById("content");
29 var cs = document.defaultView.getComputedStyle(div);
31 var chars = {
32 0x09: true, // tab
33 0x0a: true, // newline
34 0x0b: false, // vertical tab (MAY CHANGE IN FUTURE!)
35 0x0c: true, // form feed
36 0x0d: true, // carriage return
37 0x0e: false,
38 0x20: true, // space
39 0x2003: false,
40 0x200b: false,
41 0x2028: false,
42 0x2029: false,
43 0x3000: false
46 var wsmap = {
47 false: { str: " NOT", "text-decoration-line": "none", "visibility": "visible" },
48 true: { str: "", "text-decoration-line": "underline", "visibility": "hidden" }
51 for (var char in chars) {
52 var is_whitespace = chars[char];
53 var mapent = wsmap[is_whitespace];
54 div.setAttribute("class", "classvalue" + String.fromCharCode(char) + "b")
55 div.setAttribute("title", "a" + String.fromCharCode(char) + "titlevalue")
56 for (var prop of ["text-decoration-line", "visibility"]) {
57 is(cs.getPropertyValue(prop), mapent[prop],
58 "Character " + char + " should" + mapent.str +
59 " be treated as whitespace ("
60 + prop + " should be " + mapent[prop] + ")");
66 </script>
67 </pre>
68 </body>
69 </html>