4 https://bugzilla.mozilla.org/show_bug.cgi?id=391034
7 <title>Test for Bug
391034</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=391034">Mozilla Bug
391034</a>
14 <div id=
"display" style=
"width: 90px; height: 80px">
15 <div id=
"width-ref" style=
"width: 2ch"></div>
16 <div id=
"width-ref2" style=
"width: 5ch"></div>
17 <div id=
"one" style=
"position: relative; left: 2ch; bottom: 5ch"></div>
18 <div id=
"two" style=
"position: relative; left: 10%; bottom: 20%"></div>
19 <div id=
"three" style=
"position: relative; left: 10px; bottom: 6px"></div>
21 <div id=
"content" style=
"display: none">
22 <div id=
"four" style=
"position: relative; left: 10%; bottom: 20%"></div>
25 <script class=
"testbody" type=
"text/javascript">
27 /** Test for Bug
391034 **/
28 function getComp(id) {
29 return document.defaultView.getComputedStyle($(id),
"");
32 is(getComp(
"one").top,
"-" + getComp(
"width-ref2").width,
33 "Incorrect computed top offset if specified in ch")
34 is(getComp(
"one").right,
"-" + getComp(
"width-ref").width,
35 "Incorrect computed right offset if specified in ch")
36 is(getComp(
"one").bottom, getComp(
"width-ref2").width,
37 "Incorrect computed bottom offset if specified in ch")
38 is(getComp(
"one").left, getComp(
"width-ref").width,
39 "Incorrect computed left offset if specified in ch")
41 is(getComp(
"two").top,
"-16px",
42 "Incorrect computed top offset if specified in %")
43 is(getComp(
"two").right,
"-9px",
44 "Incorrect computed right offset if specified in %")
45 is(getComp(
"two").bottom,
"16px",
46 "Incorrect computed bottom offset if specified in %")
47 is(getComp(
"two").left,
"9px",
48 "Incorrect computed left offset if specified in %")
50 is(getComp(
"three").top,
"-6px",
51 "Incorrect computed top offset if specified in %")
52 is(getComp(
"three").right,
"-10px",
53 "Incorrect computed right offset if specified in %")
54 is(getComp(
"three").bottom,
"6px",
55 "Incorrect computed bottom offset if specified in %")
56 is(getComp(
"three").left,
"10px",
57 "Incorrect computed left offset if specified in %")
59 is(getComp(
"four").top,
"0px",
60 "Incorrect undisplayed computed top offset if specified in %")
61 is(getComp(
"four").right,
"0px",
62 "Incorrect undisplayed computed right offset if specified in %")
63 is(getComp(
"four").bottom,
"0px",
64 "Incorrect undisplayed computed bottom offset if specified in %")
65 is(getComp(
"four").left,
"0px",
66 "Incorrect undisplayed computed left offset if specified in %")