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.)

     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 type="text/javascript" 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
    44 };
    46 var wsmap = {
    47   false: { str: " NOT", "text-decoration": "none", "visibility": "visible" },
    48   true: { str: "", "text-decoration": "underline", "visibility": "hidden" }
    49 };
    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", "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] + ")");
    61   }
    62 }
    66 </script>
    67 </pre>
    68 </body>
    69 </html>

mercurial