4 https://bugzilla.mozilla.org/show_bug.cgi?id=412901
7 <title>Test for Bug
412901</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=412901">Mozilla Bug
412901</a>
14 <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;">
15 <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;">
18 <div id=
"content" style=
"display: none">
22 <script class=
"testbody" type=
"text/javascript">
24 /** Test for Bug
412901 **/
26 var div = document.getElementById(
"testDiv");
27 var computedStyle = document.defaultView.getComputedStyle(div,
"");
28 // we never round down to
0px, very small widths are rounded up to
1px
29 is(computedStyle.borderLeftWidth,
"1px");
30 is(computedStyle.borderRightWidth,
"0px");
31 is(computedStyle.borderTopWidth,
"2px");
32 is(computedStyle.borderBottomWidth,
"5px");
34 var div2 = document.getElementById(
"testDiv2");
35 var computedStyle2 = document.defaultView.getComputedStyle(div2,
"");
36 is(computedStyle2.borderLeftWidth,
"0px");
37 is(computedStyle2.borderRightWidth,
"0px");
38 is(computedStyle2.borderTopWidth,
"0px");
39 is(computedStyle2.borderBottomWidth,
"0px");