2 <script src="../js/resources/js-test-pre.js"></script>
4 function getCenterFor(element)
6 var rect = element.getBoundingClientRect();
7 return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt((rect.top + rect.bottom) / 2)};
12 if (!window.layoutTestController)
14 if (!window.eventSender)
17 layoutTestController.waitUntilDone();
18 layoutTestController.dumpAsText();
20 alert("Scroll position " + document.body.scrollTop);
21 center = getCenterFor(document.getElementById("sp"));
22 eventSender.mouseMoveTo(center.x, center.y);
23 eventSender.mouseDown();
24 eventSender.mouseUp();
25 eventSender.keyDown("downArrow");
26 setTimeout(verifyScrolling, 15);
29 function verifyScrolling()
31 debug("Scroll position is more than 0");
32 shouldBe("document.body.scrollTop > 0", "true");
33 layoutTestController.notifyDone();
39 <body onload="runTest();">
40 <input type="radio" id="myradio">Click the text below and then try to scroll.<br>
41 <div id="console"></div>
42 <script src="../js/resources/js-test-post.js"></script>
43 <br><br><br><br><br><br><br><br><br><br>
44 <span tabindex=1 id="sp">My span</span>
45 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>