[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / scroll-after-click-on-tab-index.html
1 <html>
2 <script src="../js/resources/js-test-pre.js"></script>
3 <script>
4 function getCenterFor(element)
5 {
6   var rect = element.getBoundingClientRect();
7   return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt((rect.top + rect.bottom) / 2)};
8 }
9
10 function runTest()
11 {
12   if (!window.layoutTestController)
13     return;
14   if (!window.eventSender)
15     return;
16
17   layoutTestController.waitUntilDone();
18   layoutTestController.dumpAsText();
19
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);
27 }
28
29 function verifyScrolling()
30 {
31   debug("Scroll position is more than 0");
32   shouldBe("document.body.scrollTop > 0", "true");
33   layoutTestController.notifyDone();
34 }
35
36 </script>
37 <style>
38 </style>
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>
46 </body>
47 </html>
48