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

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

Issue 2404393003: Tie scroll anchoring adjustments to frame lifecycle instead of layout. (Closed)
Patch Set: Created 4 years, 2 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 533e7795aa74dc62a7986affcf706dca4ab6783c..96adda51d2cc0cda585e0f0e354b837ddf6a7e27 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -399,7 +399,7 @@ void LayoutBlock::layout() {
bool needsScrollAnchoring =
hasOverflowClip() && getScrollableArea()->shouldPerformScrollAnchoring();
if (needsScrollAnchoring)
- getScrollableArea()->scrollAnchor()->save();
+ getScrollableArea()->scrollAnchor()->notifyBeforeLayout();
// Table cells call layoutBlock directly, so don't add any logic here. Put
// code into layoutBlock().
@@ -412,16 +412,6 @@ void LayoutBlock::layout() {
clearLayoutOverflow();
invalidateBackgroundObscurationStatus();
-
- // If clamping is delayed, we will restore in
- // PaintLayerScrollableArea::clampScrollPositionsAfterLayout.
- // Restoring during the intermediate layout may clamp the scroller to the
- // wrong bounds.
- bool clampingDelayed = PaintLayerScrollableArea::DelayScrollOffsetClampScope::
- clampingIsDelayed();
- if (needsScrollAnchoring && !clampingDelayed)
- getScrollableArea()->scrollAnchor()->restore();
-
m_heightAvailableToChildrenChanged = false;
}

Powered by Google App Engine
This is Rietveld 408576698