Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
index ef02d56e2f91c34acb000b704f507d7d91b3ea27..cb5500a93959ed72957af3adadf0b1c9d534d3bc 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -754,7 +754,7 @@ void PaintLayerScrollableArea::clampScrollPositionsAfterLayout() |
DoublePoint clamped = clampScrollPosition(scrollPositionDouble()); |
// Restore before clamping because clamping clears the scroll anchor. |
- if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring() && m_scrollAnchor.hasScroller()) { |
+ if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring()) { |
m_scrollAnchor.restore(); |
clamped = clampScrollPosition(scrollPositionDouble()); |
} |
@@ -766,6 +766,13 @@ void PaintLayerScrollableArea::clampScrollPositionsAfterLayout() |
m_scrollbarManager.destroyDetachedScrollbars(); |
} |
+bool PaintLayerScrollableArea::shouldPerformScrollAnchoring() const |
+{ |
+ return RuntimeEnabledFeatures::scrollAnchoringEnabled() |
+ && m_scrollAnchor.hasScroller() |
+ && layoutBox()->style()->overflowAnchor() != AnchorNone; |
+} |
+ |
ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const |
{ |
return box().style()->getScrollBehavior(); |