|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=412901 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 412901</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 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=412901">Mozilla Bug 412901</a> |
|
13 <div id="testDiv" style="width:20px; height:20px; border:solid silver; border-left-width:0.2px; border-right-width:0px; border-top-width:2.3px; border-bottom-width:5.5px;"> |
|
14 <div id="testDiv2" style="width:20px; height:20px; border:hidden solid silver; border-left-width:0.2px; border-right-width:0px; border-top-width:2.3px; border-bottom-width:5.5px;"> |
|
15 <p id="display"></p> |
|
16 </div> |
|
17 <div id="content" style="display: none"> |
|
18 |
|
19 </div> |
|
20 <pre id="test"> |
|
21 <script class="testbody" type="text/javascript"> |
|
22 |
|
23 /** Test for Bug 412901 **/ |
|
24 |
|
25 var div = document.getElementById("testDiv"); |
|
26 var computedStyle = document.defaultView.getComputedStyle(div, ""); |
|
27 // we never round down to 0px, very small widths are rounded up to 1px |
|
28 is(computedStyle.borderLeftWidth, "1px"); |
|
29 is(computedStyle.borderRightWidth, "0px"); |
|
30 is(computedStyle.borderTopWidth, "2px"); |
|
31 is(computedStyle.borderBottomWidth, "5px"); |
|
32 |
|
33 var div2 = document.getElementById("testDiv2"); |
|
34 var computedStyle2 = document.defaultView.getComputedStyle(div2, ""); |
|
35 is(computedStyle2.borderLeftWidth, "0px"); |
|
36 is(computedStyle2.borderRightWidth, "0px"); |
|
37 is(computedStyle2.borderTopWidth, "0px"); |
|
38 is(computedStyle2.borderBottomWidth, "0px"); |
|
39 </script> |
|
40 </pre> |
|
41 </body> |
|
42 </html> |