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

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

Issue 1930183002: Refactor scroll updates during flexbox layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@rtl-scroll-origin
Patch Set: nits Created 4 years, 6 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/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index f7858bf5709d610c8f1ecbe29471de3b5d911237..4edc22e0c43ca21f8aaf5818daa5a55efc862f27 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -336,25 +336,22 @@ void LayoutFlexibleBox::layoutBlock(bool relayoutChildren)
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
+ PaintLayerScrollableArea::DelayScrollPositionClampScope delayClampScope;
+
{
TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
LayoutState state(*this, locationOffset());
m_numberOfInFlowChildrenOnFirstLine = -1;
- LayoutBlock::startDelayUpdateScrollInfo();
-
prepareOrderIteratorAndMargins();
layoutFlexItems(relayoutChildren, layoutScope);
-
- ScrollPositionMap scrollMap;
- if (LayoutBlock::finishDelayUpdateScrollInfo(&layoutScope, &scrollMap)) {
+ if (PaintLayerScrollableArea::PreventRelayoutScope::relayoutNeeded()) {
+ PaintLayerScrollableArea::FreezeScrollbarsScope freezeScrollbarsScope;
prepareOrderIteratorAndMargins();
- layoutFlexItems(false, layoutScope);
- for (auto& entry : scrollMap) {
- entry.key->scrollToPosition(entry.value, ScrollOffsetClamped);
- }
+ layoutFlexItems(true, layoutScope);
+ PaintLayerScrollableArea::PreventRelayoutScope::resetRelayoutNeeded();
}
if (logicalHeight() != previousHeight)
@@ -851,6 +848,8 @@ void LayoutFlexibleBox::layoutFlexItems(bool relayoutChildren, SubtreeLayoutScop
Vector<LayoutUnit, 16> childSizes;
+ PaintLayerScrollableArea::PreventRelayoutScope preventRelayoutScope(layoutScope);
+
dirtyForLayoutFromPercentageHeightDescendants(layoutScope);
m_orderIterator.first();

Powered by Google App Engine
This is Rietveld 408576698