| <script src="../../resources/js-test.js"></script> |
| function getCenterFor(element) |
| var rect = element.getBoundingClientRect(); |
| return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt((rect.top + rect.bottom) / 2)}; |
| alert("Scroll position " + document.scrollingElement.scrollTop); |
| center = getCenterFor(document.getElementById("sp")); |
| eventSender.mouseMoveTo(center.x, center.y); |
| eventSender.keyDown("downArrow"); |
| intervalID = setInterval(function() { |
| if (document.scrollingElement.scrollTop > 0) { |
| testPassed("Scroll position is more than 0"); |
| timeoutID = setTimeout(function() { |
| testFailed("Scroll position was still 10 after 20 seconds"); |
| clearInterval(intervalID); |
| <body onload="runTest();"> |
| <input type="radio" id="myradio">Click the text below and then try to scroll.<br> |
| <br><br><br><br><br><br><br><br><br><br> |
| <span tabindex=1 id="sp">My span</span> |
| <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> |