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); |