layout/forms/test/test_bug477531.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=477531
     5 -->
     6 <head>
     7   <title>Test for Bug 477531</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    11   <style type="text/css">
    12     #s {
    13       margin-left: 10px;
    14     }
    16     #s:indeterminate {
    17       margin-left: 30px;
    18     }
    19   </style>
    20 </head>
    21 <body>
    22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=477531">Mozilla Bug 477531</a>
    23 <p id="display"></p>
    24 <div id="content">
    26 <input type="checkbox" id="s" />
    28 </div>
    29 <pre id="test">
    30 <script class="testbody" type="text/javascript">
    32 /** Test for Bug 477531 **/
    33 is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"),
    34    "10px",
    35    "Non-indeterminate checkbox should have a margin of 10px");
    37 $("s").indeterminate = true;
    39 is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"),
    40    "30px",
    41    "Indeterminate checkbox should have a margin of 30px");
    43 $("s").setAttribute("type", "radio");
    45 is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"),
    46    "10px",
    47    "Only checkboxes should have indeterminate styles applied to them");
    49 $("s").setAttribute("type", "checkbox");
    51 is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"),
    52    "30px",
    53    "Setting an indeterminate element to type checkbox should give it indeterminate styles");
    55 $("s").indeterminate = false;
    57 is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"),
    58    "10px",
    59    "Newly non-indeterminate checkbox should have a margin of 10px");
    61 </script>
    62 </pre>
    63 </body>
    64 </html>

mercurial