|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=391221 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 391221</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=391221">Mozilla Bug 391221</a> |
|
13 <p id="display"> |
|
14 <div id="width-ref" style="width: 2ch"></div> |
|
15 </p> |
|
16 <div id="content" style="display: none"> |
|
17 |
|
18 <div id="one" style="width: 1000px; max-width: 2ch"></div> |
|
19 <div id="two" style="width: 0px; min-width: 2ch"></div> |
|
20 <div id="three" style="width: 1000ch; max-width: 2px"></div> |
|
21 |
|
22 </div> |
|
23 <pre id="test"> |
|
24 <script class="testbody" type="text/javascript"> |
|
25 |
|
26 /** Test for Bug 391221 **/ |
|
27 function getComp(id) { |
|
28 return document.defaultView.getComputedStyle($(id), ""); |
|
29 } |
|
30 |
|
31 is(getComp("one").width, getComp("width-ref").width, |
|
32 "max-width in ch units not working?"); |
|
33 |
|
34 is(getComp("two").width, getComp("width-ref").width, |
|
35 "min-width in ch units not working?"); |
|
36 |
|
37 is(getComp("three").width, "2px", "max-width not applied to width in chars?"); |
|
38 |
|
39 </script> |
|
40 </pre> |
|
41 </body> |
|
42 </html> |
|
43 |