Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / autoscroll-with-non-scrollable-parent.html
blob8443f4b19c80d06d5e69c3e6d5e88fa8d1ab5bdf
1 <html>
2 <head>
3 <script>
4 function log(msg)
6 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
9 function test()
11 if (window.testRunner) {
12 testRunner.waitUntilDone();
13 testRunner.dumpAsText();
14 setTimeout(autoscrollTestPart1, 0);
18 function autoscrollTestPart1()
20 var iframe = document.getElementById('NoScrolliFrame');
21 var iframeDocument = iframe.contentDocument;
22 var input = iframeDocument.getElementById('inp');
23 if (window.eventSender) {
24 var x = iframe.offsetLeft + input.offsetLeft + 7;
25 var y = iframe.offsetTop + input.offsetTop + 7;
26 eventSender.dragMode = false;
27 eventSender.mouseMoveTo(x, y);
28 eventSender.mouseDown();
29 eventSender.mouseMoveTo(x + 20, y);
30 eventSender.mouseMoveTo(x + 600, y);
32 setTimeout(autoscrollTestPart2, 100);
35 function autoscrollTestPart2()
37 if (window.eventSender)
38 eventSender.mouseUp();
40 var iframe = document.getElementById('NoScrolliFrame');
41 var iframeDocument = iframe.contentDocument;
42 if (iframeDocument.scrollingElement.scrollLeft == 0)
43 log("PASSED");
44 else
45 log("FAILED : " + iframeDocument.scrollingElement.scrollLeft + " pixels have been scrolled");
47 if (window.testRunner)
48 testRunner.notifyDone();
50 </script>
51 </head>
52 <body onload="test()">
53 <iframe id="NoScrolliFrame" scrolling="no" style="height: 100px; width: 100px" src="resources/big-page-with-input.html"></iframe>
54 <div id="console">
55 rdar://problem/6049803 <br>
56 To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field. If the autoscroll occurs the text has FAILED since the containing iframe has scrolling=no else it has PASSED.<br>
57 Though you should be able to write some long text in the input and to trigger the autoscroll within the input.<br>
58 </div>
60 </body>
61 </html>