|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
|
4 type="text/css"?> |
|
5 <!-- |
|
6 https://bugzilla.mozilla.org/show_bug.cgi?id=485118 |
|
7 --> |
|
8 <window title="Mozilla Bug 485118" |
|
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
10 |
|
11 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
|
13 |
|
14 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
15 <div id="content" style="display: none"> |
|
16 |
|
17 </div> |
|
18 <pre id="test"> |
|
19 </pre> |
|
20 </body> |
|
21 |
|
22 <hbox height="300"> |
|
23 <vbox width="300"> |
|
24 <scrollbar orient="horizontal" |
|
25 maxpos="10000" |
|
26 pageincrement="1" |
|
27 id="horizontal"/> |
|
28 <scrollbar orient="horizontal" |
|
29 maxpos="10000" |
|
30 pageincrement="1" |
|
31 style="-moz-appearance: scrollbar-small;" |
|
32 id="horizontalSmall"/> |
|
33 <hbox flex="1"> |
|
34 <scrollbar orient="vertical" |
|
35 maxpos="10000" |
|
36 pageincrement="1" |
|
37 id="vertical"/> |
|
38 <scrollbar orient="vertical" |
|
39 maxpos="10000" |
|
40 pageincrement="1" |
|
41 style="-moz-appearance: scrollbar-small;" |
|
42 id="verticalSmall"/> |
|
43 <spacer flex="1"/> |
|
44 </hbox> |
|
45 </vbox> |
|
46 </hbox> |
|
47 |
|
48 <script class="testbody" type="application/javascript"> |
|
49 <![CDATA[ |
|
50 |
|
51 SimpleTest.waitForExplicitFinish(); |
|
52 |
|
53 function runTest() { |
|
54 ["horizontal", "vertical"].forEach(function (orient) { |
|
55 ["", "Small"].forEach(function (size) { |
|
56 var elem = document.getElementById(orient + size); |
|
57 var thumbRect = document.getAnonymousElementByAttribute(elem, 'sbattr', 'scrollbar-thumb').getBoundingClientRect(); |
|
58 var sizeToCheck = orient == "horizontal" ? "width" : "height"; |
|
59 // var expectedSize = size == "Small" ? 19 : 26; |
|
60 var expectedSize = 26; |
|
61 is(thumbRect[sizeToCheck], expectedSize, size + " scrollbar has wrong minimum " + sizeToCheck); |
|
62 }); |
|
63 }); |
|
64 SimpleTest.finish(); |
|
65 } |
|
66 window.addEventListener("load", runTest, false); |
|
67 |
|
68 ]]> |
|
69 </script> |
|
70 |
|
71 </window> |