OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <script> |
| 4 function log(msg) |
| 5 { |
| 6 document.getElementById('console').appendChild(document.createTextNod
e(msg + '\n')); |
| 7 } |
| 8 |
| 9 function test() |
| 10 { |
| 11 if (window.testRunner) { |
| 12 testRunner.waitUntilDone(); |
| 13 testRunner.dumpAsText(); |
| 14 } |
| 15 |
| 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); |
| 25 } |
| 26 setTimeout(autoscrollTestPart2, 100); |
| 27 } |
| 28 |
| 29 function autoscrollTestPart2() |
| 30 { |
| 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 :-("); |
| 38 |
| 39 if (window.testRunner) |
| 40 testRunner.notifyDone(); |
| 41 } |
| 42 </script> |
| 43 </head> |
| 44 <body onload="test()"> |
| 45 <div id="description">Test ensure overflow:hidden has the same effect that ov
erflow-y:hidden has with respect to autoscroll.<br> |
| 46 To test manually, text select by draggin the text below, and move the mouse d
ownwards 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> |
OLD | NEW |