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 1895003002: Append fragmentainer groups in outer multicols first. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/fast/multicol/doubly-nested-with-increasing-row-heights-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d79383a90ff0bf8fe033178a7436e4b6add1c426..1e843382ff795cb3e5bb68a17f3df988c1596894 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp
@@ -510,7 +510,21 @@ void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded(LayoutUnit
// We have run out of columns here, so we need to add at least one more row to hold more
// columns.
+ LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragmentationContext->associatedFlowThread();
do {
+ if (enclosingFlowThread) {
+ // When we add a new row here, it implicitly means that we're inserting another
+ // column in our enclosing multicol container. That in turn may mean that we've run
+ // out of columns there too. Need to insert additional rows in ancestral multicol
+ // containers before doing it in the descendants, in order to get the height
+ // constraints right down there.
+ const MultiColumnFragmentainerGroup& lastRow = columnSet->lastFragmentainerGroup();
+ // The top offset where where the new fragmentainer group will start in this column
+ // set, converted to the coordinate space of the enclosing multicol container.
+ LayoutUnit logicalOffsetInOuter = lastRow.blockOffsetInEnclosingFragmentationContext() + lastRow.logicalHeight();
+ enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(logicalOffsetInOuter, AssociateWithLatterPage);
+ }
+
const MultiColumnFragmentainerGroup& newRow = columnSet->appendNewFragmentainerGroup();
// Zero-height rows should really not occur here, but if it does anyway, break, so that
// we don't get stuck in an infinite loop.
@@ -518,14 +532,6 @@ void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded(LayoutUnit
if (newRow.logicalHeight() <= 0)
break;
} while (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread, pageBoundaryRule));
-
- if (LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragmentationContext->associatedFlowThread()) {
- // When we add a new row here, it implicitly means that we're inserting another column
- // in our enclosing multicol container. That in turn may mean that we've run out of
- // columns there too.
- const MultiColumnFragmentainerGroup& lastRow = columnSet->lastFragmentainerGroup();
- enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(lastRow.blockOffsetInEnclosingFragmentationContext(), AssociateWithLatterPage);
- }
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/doubly-nested-with-increasing-row-heights-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698