widget/tests/test_bug485118.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial