Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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>