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

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

Issue 1489663003: column-span:all in nested multicol requires re-insertion of fragmentainer groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/LayoutMultiColumnFlowThread.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
index 043e3e5247e4532eb6f11bee69f109c3320ec3f6..8e25b9523b130a73e44cbc5d31fa9b4979cd8b15 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -372,6 +372,11 @@ void LayoutMultiColumnFlowThread::layoutColumns(SubtreeLayoutScope& layoutScope)
}
if (!m_needsColumnHeightsRecalculation)
m_needsColumnHeightsRecalculation = columnSet->heightIsAuto();
+ // Since column sets are regular block flow objects, and their position is changed in
+ // regular block layout code (with no means for the multicol code to notice unless we add
+ // hooks there), store the previous position now. If it changes in the imminent layout
+ // pass, we may have to rebalance its columns.
+ columnSet->storeOldPosition();
}
invalidateColumnSets();
@@ -393,7 +398,7 @@ bool LayoutMultiColumnFlowThread::recalculateColumnHeights()
// columns, unless we have a bug.
bool needsRelayout = false;
for (LayoutMultiColumnSet* multicolSet = firstMultiColumnSet(); multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet())
- needsRelayout |= multicolSet->recalculateColumnHeight(m_inBalancingPass ? StretchBySpaceShortage : GuessFromFlowThreadPortion);
+ needsRelayout |= multicolSet->recalculateColumnHeight();
if (needsRelayout)
setChildNeedsLayout(MarkOnlyThis);
@@ -929,15 +934,15 @@ void LayoutMultiColumnFlowThread::contentWasLaidOut(LayoutUnit logicalTopInFlowT
bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread();
if (!mayBeNested)
return;
- if (!isInInitialLayoutPass()) {
+ LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(logicalTopInFlowThreadAfterPagination);
+ if (!columnSet)
+ return;
+ if (columnSet->isInitialHeightCalculated()) {
// We only insert additional fragmentainer groups in the initial layout pass. We only want
// to balance columns in the last fragmentainer group (if we need to balance at all), so we
// want that last fragmentainer group to be the same one in all layout passes that follow.
return;
}
- LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(logicalTopInFlowThreadAfterPagination);
- if (!columnSet)
- return;
MultiColumnFragmentainerGroup& row = columnSet->fragmentainerGroupAtFlowThreadOffset(logicalTopInFlowThreadAfterPagination);
if (!row.isLastGroup())
return;

Powered by Google App Engine
This is Rietveld 408576698