Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: LayoutTests/rubberbanding/scroll-bounce-fix.html

Issue 122093002: Fix page jumping back to initial position after an overflow-bounce scroll. Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: does not fail :-/ Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/rubberbanding/scroll-bounce-fix.html
diff --git a/LayoutTests/rubberbanding/momentum-reset.html b/LayoutTests/rubberbanding/scroll-bounce-fix.html
similarity index 51%
copy from LayoutTests/rubberbanding/momentum-reset.html
copy to LayoutTests/rubberbanding/scroll-bounce-fix.html
index 4f0736504c823840bb6aca11c8d834754a4ed6a0..98a77c4903b967d6919b80c1e6c4429cf9adf6c8 100644
--- a/LayoutTests/rubberbanding/momentum-reset.html
+++ b/LayoutTests/rubberbanding/scroll-bounce-fix.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
-<head><title>Tests that a momentum scroll (i.e. a fling) eventually resets back to no-overhang state</title></head>
+<head><title>Tests that a momentum scroll (i.e. a fling) doesn't jump vertically</title></head>
<body>
<div id="box" style="height:800px; background: red; border:2px solid black; width:100%"></div>
<div id="info">This test requires DRT.</div>
@@ -15,27 +15,30 @@
// Simulate a momentum scroll following the end of a normal scroll.
eventSender.mouseMomentumBegin();
- eventSender.mouseMomentumScrollBy(0, 250, false, true);
+ eventSender.mouseMomentumScrollBy(250, -250, false, true);
eventSender.mouseMomentumEnd();
// The momentum scroll above should have resulted in overflow above the page.
// Ensure that it has (via scrollTop) and register an onscroll listener to
- // ensure that the timer restores the position.
+ // ensure that the timer restores the x position but keeps y unchanged.
if (document.documentElement.scrollTop == 0) {
// FAIL: Above didn't result in overscroll.
document.getElementById('box').style.background = 'blue';
- return;
+ } else {
+ document.getElementById('box').style.background = 'green';
+ //// Wait for the timer to restore the position.
+ //testRunner.waitUntilDone();
eseidel 2014/05/29 00:12:20 Did you mean to comment out this code?
+ //var startedScrolling = false;
+ //window.onscroll = function() {
+ // if (document.documentElement.scrollLeft == 0) {
+ // if (document.documentElement.scrollTop != 250) {
+ // // FAIL: Horizontal position shouldn't have snapped back.
+ // documentElement.getElementById('box').style.background = 'gray';
+ // }
+ // testRunner.notifyDone();
+ // }
+ //};
}
-
- document.getElementById('box').style.background = 'green';
- // Wait for the timer to restore the position.
- testRunner.waitUntilDone();
- var startedScrolling = false;
- window.onscroll = function() {
- if (document.documentElement.scrollTop == 0) {
- testRunner.notifyDone();
- }
- };
}
</script>
</body>
« no previous file with comments | « no previous file | Source/platform/mac/ScrollAnimatorMac.h » ('j') | Source/platform/mac/ScrollElasticityController.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698