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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 1647793002: Use ScrollAnchor in FrameView and PaintLayerScrollableArea. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@anchor-skeleton
Patch Set: Created 4 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: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index a53a7603bd935af6e556c0e1855197b420c4c62f..c3936cbacd784f5846da1c674e8217643aa71230 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -287,6 +287,8 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren)
LayoutAnalyzer::BlockScope analyzer(*this);
SubtreeLayoutScope layoutScope(*this);
+ if (scrollAnchoringEnabled() && hasOverflowClip())
+ scrollableArea()->scrollAnchor().save();
ojan 2016/02/02 06:51:01 Can you instead do this in LayoutBlock::layout()?
skobes 2016/02/02 22:39:10 I thought about this but was scared off by the com
ojan 2016/02/03 06:17:52 Yes, that way the code will work for flex/grid/etc
// Multiple passes might be required for column based layout.
// The number of passes could be as high as the number of columns.
@@ -304,6 +306,8 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren)
// Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
updateScrollInfoAfterLayout();
+ if (scrollAnchoringEnabled() && hasOverflowClip())
+ scrollableArea()->scrollAnchor().restore();
if (m_paintInvalidationLogicalTop != m_paintInvalidationLogicalBottom) {
bool hasVisibleContent = style()->visibility() == VISIBLE;

Powered by Google App Engine
This is Rietveld 408576698