1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/tests/test_bug485118.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,71 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 1.7 + type="text/css"?> 1.8 +<!-- 1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=485118 1.10 +--> 1.11 +<window title="Mozilla Bug 485118" 1.12 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.13 + 1.14 + <script type="application/javascript" 1.15 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.16 + 1.17 +<body xmlns="http://www.w3.org/1999/xhtml"> 1.18 +<div id="content" style="display: none"> 1.19 + 1.20 +</div> 1.21 +<pre id="test"> 1.22 +</pre> 1.23 +</body> 1.24 + 1.25 +<hbox height="300"> 1.26 + <vbox width="300"> 1.27 + <scrollbar orient="horizontal" 1.28 + maxpos="10000" 1.29 + pageincrement="1" 1.30 + id="horizontal"/> 1.31 + <scrollbar orient="horizontal" 1.32 + maxpos="10000" 1.33 + pageincrement="1" 1.34 + style="-moz-appearance: scrollbar-small;" 1.35 + id="horizontalSmall"/> 1.36 + <hbox flex="1"> 1.37 + <scrollbar orient="vertical" 1.38 + maxpos="10000" 1.39 + pageincrement="1" 1.40 + id="vertical"/> 1.41 + <scrollbar orient="vertical" 1.42 + maxpos="10000" 1.43 + pageincrement="1" 1.44 + style="-moz-appearance: scrollbar-small;" 1.45 + id="verticalSmall"/> 1.46 + <spacer flex="1"/> 1.47 + </hbox> 1.48 + </vbox> 1.49 +</hbox> 1.50 + 1.51 +<script class="testbody" type="application/javascript"> 1.52 +<![CDATA[ 1.53 + 1.54 +SimpleTest.waitForExplicitFinish(); 1.55 + 1.56 +function runTest() { 1.57 + ["horizontal", "vertical"].forEach(function (orient) { 1.58 + ["", "Small"].forEach(function (size) { 1.59 + var elem = document.getElementById(orient + size); 1.60 + var thumbRect = document.getAnonymousElementByAttribute(elem, 'sbattr', 'scrollbar-thumb').getBoundingClientRect(); 1.61 + var sizeToCheck = orient == "horizontal" ? "width" : "height"; 1.62 + // var expectedSize = size == "Small" ? 19 : 26; 1.63 + var expectedSize = 26; 1.64 + is(thumbRect[sizeToCheck], expectedSize, size + " scrollbar has wrong minimum " + sizeToCheck); 1.65 + }); 1.66 + }); 1.67 + SimpleTest.finish(); 1.68 +} 1.69 +window.addEventListener("load", runTest, false); 1.70 + 1.71 +]]> 1.72 +</script> 1.73 + 1.74 +</window>