Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / autoscroll-overflow-hidden-longhands.html
blobb2a900e3298fd30bb526f81b5073788f7c278f8b
1 <!DOCTYPE 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();
16 var textInDiv = document.getElementById('textInDiv');
17 if (window.eventSender) {
18 var x = textInDiv.offsetLeft + 17;
19 var y = textInDiv.offsetTop + 7;
20 eventSender.dragMode = false;
21 eventSender.mouseMoveTo(x, y);
22 eventSender.mouseDown();
23 eventSender.mouseMoveTo(x, y + 20);
24 eventSender.mouseMoveTo(x, y + 220);
26 setTimeout(autoscrollTestPart2, 100);
29 function autoscrollTestPart2()
31 if (window.eventSender)
32 eventSender.mouseUp();
33 var sd = document.getElementById('nonScrollableDiv');
34 if (sd.scrollTop == 0)
35 log("PASSED : the autoscroll did not happen!");
36 else
37 log("FAILED : the autoscroll has happened :-(");
39 if (window.testRunner)
40 testRunner.notifyDone();
42 </script>
43 </head>
44 <body onload="test()">
45 <div id="description">Test ensure overflow:hidden has the same effect that overflow-y:hidden has with respect to autoscroll.<br>
46 To test manually, text select by draggin the text below, and move the mouse downwards out of the div boundary. It should not scroll!
47 </div>
48 <div id="nonScrollableDiv" style="height: 100px; overflow-x: auto; overflow-y: hidden; width: 100px">
49 <div id="tailDiv" style=" height: 1000px; background-color: yellow">
50 <span id='textInDiv'> Try to autoscroll this text.<br>
51 </div>
52 </div>
53 <div id="console"></div>
54 </body>
55 </html>