| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head><title>Tests that a momentum scroll (i.e. a fling) eventually resets back
to no-overhang state</title></head> | |
| 4 <body> | |
| 5 <div id="box" style="height:800px; background: red; border:2px solid black; widt
h:100%"></div> | |
| 6 <div id="info">This test requires DRT.</div> | |
| 7 <script> | |
| 8 if (window.internals) { | |
| 9 document.getElementById('info').style.visibility = 'hidden'; | |
| 10 internals.settings.setMockScrollbarsEnabled(false); | |
| 11 | |
| 12 eventSender.mouseMoveTo(10, 10); | |
| 13 eventSender.mouseDragBegin(); | |
| 14 eventSender.mouseDragEnd(); | |
| 15 | |
| 16 // Simulate a momentum scroll following the end of a normal scroll. | |
| 17 eventSender.mouseMomentumBegin2(0, 0, false, true); | |
| 18 eventSender.mouseMomentumScrollBy(0, 250, false, true); | |
| 19 eventSender.mouseMomentumEnd(); | |
| 20 | |
| 21 // The momentum scroll above should have resulted in overflow above the
page. | |
| 22 // Ensure that it has (via scrollTop) and register an onscroll listener
to | |
| 23 // ensure that the timer restores the position. | |
| 24 if (document.documentElement.scrollTop == 0) { | |
| 25 // FAIL: Above didn't result in overscroll. | |
| 26 document.getElementById('box').style.background = 'blue'; | |
| 27 } else { | |
| 28 | |
| 29 document.getElementById('box').style.background = 'green'; | |
| 30 // Wait for the timer to restore the position. | |
| 31 testRunner.waitUntilDone(); | |
| 32 var startedScrolling = false; | |
| 33 window.onscroll = function() { | |
| 34 if (document.documentElement.scrollTop == 0) { | |
| 35 testRunner.notifyDone(); | |
| 36 } | |
| 37 }; | |
| 38 } | |
| 39 } | |
| 40 </script> | |
| 41 </body> | |
| 42 </html> | |
| OLD | NEW |