[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / autoscroll.html
1 <html>
2     <head>
3         <script>
4             function test()
5             {
6                 if (window.layoutTestController) {
7                     layoutTestController.waitUntilDone();
8                     setTimeout(autoscrollTestPart1, 0);
9                 }
10             }
11             function autoscrollTestPart1()
12             {
13                 var ta = document.getElementById('ta');
14                 if (window.eventSender) {
15                     ta.scrollIntoView();
16                     var h = ta.offsetTop - document.body.scrollTop + 10;
17                     eventSender.dragMode = false;
18                     eventSender.mouseMoveTo(20, h);
19                     eventSender.mouseDown();
20                     eventSender.mouseMoveTo(20, h);
21                     eventSender.mouseMoveTo(100, h);
22                 }
23                 setTimeout(autoscrollTestPart2, 100);
24             }
25             function autoscrollTestPart2()
26             {
27                 if (window.eventSender)
28                     eventSender.mouseUp();
29                 if (window.layoutTestController)
30                     layoutTestController.notifyDone();
31             }
32             function log(msg)
33             {
34                 var res = document.getElementById('res');
35                 res.innerHTML = res.innerHTML + msg + "<br>";
36             }
37         </script>
38     </head>
39     <body onload="test()">
40         <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12331">bug 12331</a>.</p>
41         <p>To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll back up to the top.</p>
42         <div style="height:3000px"></div>
43         <input id="ta" value="select some of this text"></input>
44         <p>If the bug does not occur, you'll be left down here at the bottom.</p>
45     </body>
46 </html>