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

Unified Diff: Source/platform/mac/ScrollAnimatorMac.mm

Issue 282743002: Fix page jumping back to initial position after an overflow-bounce scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove whitespace from TestExpectations that was causing a rebase failure. Created 6 years, 7 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
« no previous file with comments | « Source/platform/mac/ScrollAnimatorMac.h ('k') | Source/platform/mac/ScrollElasticityController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/mac/ScrollAnimatorMac.mm
diff --git a/Source/platform/mac/ScrollAnimatorMac.mm b/Source/platform/mac/ScrollAnimatorMac.mm
index 42ed965d13bfa790771c3dfcb63df8668a8ca085..e4cf2b00ee53e407ff0ebefcdcb06f7ea253232f 100644
--- a/Source/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/platform/mac/ScrollAnimatorMac.mm
@@ -693,6 +693,18 @@ FloatPoint ScrollAnimatorMac::adjustScrollPositionIfNecessary(const FloatPoint&
return FloatPoint(newX, newY);
}
+void ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary()
+{
+ bool currentlyConstrainsToContentEdge = m_scrollableArea->constrainsScrollingToContentEdge();
+ m_scrollableArea->setConstrainsScrollingToContentEdge(true);
+
+ IntPoint currentScrollPosition = absoluteScrollPosition();
+ FloatPoint nearestPointWithinBounds = adjustScrollPositionIfNecessary(absoluteScrollPosition());
+ immediateScrollBy(nearestPointWithinBounds - currentScrollPosition);
+
+ m_scrollableArea->setConstrainsScrollingToContentEdge(currentlyConstrainsToContentEdge);
+}
+
void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
{
FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
« no previous file with comments | « Source/platform/mac/ScrollAnimatorMac.h ('k') | Source/platform/mac/ScrollElasticityController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698