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

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

Issue 1647793002: Use ScrollAnchor in FrameView and PaintLayerScrollableArea. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@anchor-skeleton
Patch Set: move save/restore from LayoutBlockFlow into LayoutBlock 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/LayoutBlock.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 884d88c7c867f4c4d64bfbc974ddf4acb98d2b54..ca0820104bca6e25983d581b066834c04425cd4b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -897,6 +897,10 @@ void LayoutBlock::layout()
{
LayoutAnalyzer::Scope analyzer(*this);
+ bool needsScrollAnchoring = RuntimeEnabledFeatures::scrollAnchoringEnabled() && hasOverflowClip();
+ if (needsScrollAnchoring)
+ scrollableArea()->scrollAnchor().save();
+
// Table cells call layoutBlock directly, so don't add any logic here. Put code into
// layoutBlock().
layoutBlock(false);
@@ -907,6 +911,9 @@ void LayoutBlock::layout()
clearLayoutOverflow();
invalidateBackgroundObscurationStatus();
+
+ if (needsScrollAnchoring)
+ scrollableArea()->scrollAnchor().restore();
}
bool LayoutBlock::widthAvailableToChildrenHasChanged()

Powered by Google App Engine
This is Rietveld 408576698