Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-readonly-autoscroll.html
blobf8ef7b87dd5b5a773e89fabf9c54dfb2156afb3c
1 <html>
2 <head>
3 <script>
4 function test()
6 if (window.testRunner) {
7 testRunner.waitUntilDone();
8 setTimeout(autoscrollTestPart1, 0);
11 function autoscrollTestPart1()
13 var tf = document.getElementById('tf');
14 if (window.eventSender) {
15 tf.scrollIntoView();
16 var h = tf.offsetTop - document.scrollingElement.scrollTop + 10;
17 eventSender.dragMode = false;
18 eventSender.mouseMoveTo(20, h);
19 eventSender.mouseDown();
20 eventSender.mouseMoveTo(20, h);
21 eventSender.mouseMoveTo(300, h);
23 setTimeout(autoscrollTestPart2, 100);
25 function autoscrollTestPart2()
27 if (window.eventSender)
28 eventSender.mouseUp();
29 log("ScrollLeft: " + document.getElementById('tf').scrollLeft);
30 if (window.testRunner)
31 testRunner.notifyDone();
33 function log(msg)
35 var res = document.getElementById('res');
36 res.innerHTML = res.innerHTML + msg + "<br>";
38 </script>
39 </head>
40 <body onload="test()">
41 <p>Test for <a href=http://bugs.webkit.org/show_bug.cgi?id=11534">bug 11534</a>.</p>
42 <p>Readonly text fields don't scroll when selecting content.</p>
43 <input id="tf" readonly value="abcdefghijklmnopqrstuvwxyz"></input>
44 <div id="res"></div>
45 </body>
46 </html>