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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2176523003: FrameView shouldn't apply scroll anchoring when root layer scrolling is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698