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

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

Issue 1167323003: Need deeper layout passes inside flexboxes when fragmenting (pagination, multicol). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/Source/core/layout/LayoutFlexibleBox.cpp b/Source/core/layout/LayoutFlexibleBox.cpp
index af55d88773248b99ee902f3a0fadfa30d70daf44..b1546e1d640bac71d00b8833a9f4b628c33062a4 100644
--- a/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/Source/core/layout/LayoutFlexibleBox.cpp
@@ -233,6 +233,7 @@ void LayoutFlexibleBox::layoutBlock(bool relayoutChildren)
if (updateLogicalWidthAndColumnWidth())
relayoutChildren = true;
+ SubtreeLayoutScope layoutScope(*this);
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
@@ -249,7 +250,7 @@ void LayoutFlexibleBox::layoutBlock(bool relayoutChildren)
ChildFrameRects oldChildRects;
appendChildFrameRects(oldChildRects);
- layoutFlexItems(relayoutChildren);
+ layoutFlexItems(relayoutChildren, layoutScope);
LayoutBlock::finishDelayUpdateScrollInfo();
@@ -645,7 +646,7 @@ LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild(LayoutBox& child,
return std::max(LayoutUnit(), computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis));
}
-void LayoutFlexibleBox::layoutFlexItems(bool relayoutChildren)
+void LayoutFlexibleBox::layoutFlexItems(bool relayoutChildren, SubtreeLayoutScope& layoutScope)
{
Vector<LineContext> lineContexts;
OrderedFlexItemList orderedChildren;
@@ -669,7 +670,7 @@ void LayoutFlexibleBox::layoutFlexItems(bool relayoutChildren)
ASSERT(inflexibleItems.size() > 0);
}
- layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, availableFreeSpace, relayoutChildren, lineContexts);
+ layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, availableFreeSpace, relayoutChildren, layoutScope, lineContexts);
}
if (hasLineIfEmpty()) {
// Even if computeNextFlexLine returns true, the flexbox might not have
@@ -1110,7 +1111,7 @@ EOverflow LayoutFlexibleBox::mainAxisOverflowForChild(LayoutBox& child) const
return child.styleRef().overflowY();
}
-void LayoutFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexItemList& children, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace, bool relayoutChildren, Vector<LineContext>& lineContexts)
+void LayoutFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexItemList& children, const Vector<LayoutUnit, 16>& childSizes, LayoutUnit availableFreeSpace, bool relayoutChildren, SubtreeLayoutScope& layoutScope, Vector<LineContext>& lineContexts)
{
ASSERT(childSizes.size() == children.size());
@@ -1148,6 +1149,8 @@ void LayoutFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
// We may have already forced relayout for orthogonal flowing children in computeInnerFlexBaseSizeForChild.
bool forceChildRelayout = relayoutChildren && !childFlexBaseSizeRequiresLayout(*child);
updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, *child);
+ if (!child->needsLayout())
+ child->markForPaginationRelayoutIfNeeded(layoutScope);
child->layoutIfNeeded();
updateAutoMarginsInMainAxis(*child, autoMarginOffset);
« no previous file with comments | « Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698