layout/style/test/test_bug437915.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial