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

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

Issue 2509813004: Improve strut handling in initial column balancing pass. (Closed)
Patch Set: Rebaseline for column-rules-fixed-height. This test no longer triggers deep layout. Created 4 years, 1 month 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/Source/core/layout/ColumnBalancer.cpp ('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/MultiColumnFragmentainerGroup.cpp
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
index e8a89294b234556fb1657b9f1935f098034b8ddc..207bd03e4206d4767929569812a691569581d6de 100644
--- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
+++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -46,16 +46,24 @@ void MultiColumnFragmentainerGroup::resetColumnHeight() {
flowThread->enclosingFragmentationContext();
if (enclosingFragmentationContext &&
enclosingFragmentationContext->isFragmentainerLogicalHeightKnown()) {
- // Even if height is auto, we set an initial height, in order to tell how
- // much content this MultiColumnFragmentainerGroup can hold, and when we
- // need to append a new one.
+ // Set an initial height, based on the fragmentainer height in the outer
+ // fragmentation context, in order to tell how much content this
+ // MultiColumnFragmentainerGroup can hold, and when we need to append a
+ // new one.
m_columnHeight = m_maxColumnHeight;
- } else {
- m_columnHeight = LayoutUnit();
+ return;
}
+ }
+ // If the multicol container has a definite height, use it as the column
+ // height. This even applies when we are to balance the columns. We'll still
+ // use the definite height as an initial height, and lay out once at that
+ // column height. If it turns out that the content needs less than this
+ // height, we have to balance and shrink the height and lay out the columns
+ // over again.
+ if (LayoutUnit logicalHeight = flowThread->columnHeightAvailable()) {
+ setAndConstrainColumnHeight(heightAdjustedForRowOffset(logicalHeight));
} else {
- setAndConstrainColumnHeight(
- heightAdjustedForRowOffset(flowThread->columnHeightAvailable()));
+ m_columnHeight = LayoutUnit();
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/ColumnBalancer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698