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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 879483002: [New Multicolumn] Intrinsic/preferred logical width calculation for spanners. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review Created 5 years, 11 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: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index cef0c517f6daa44f7db1c7f8a2e2b92dd65fbb52..aef2895bd5757cd85e4ccb23a5548e8bad8f0f2f 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -2956,7 +2956,11 @@ void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Lay
maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
- adjustIntrinsicLogicalWidthsForColumns(minLogicalWidth, maxLogicalWidth);
+ // The new ("region based") multicol implementation will do this adjustment on the flow thread,
Julien - ping for review 2015/01/27 09:31:37 Let's remove the use of 'new' as we will want to s
mstensho (USE GERRIT) 2015/01/27 10:20:23 Done.
+ // and not here on the multicol container, so that spanners won't incorrectly be treated as
+ // column content (and have spanners' preferred widths multiplied by the number of columns, etc.).
+ if (style()->specifiesColumns() && !document().regionBasedColumnsEnabled())
+ adjustIntrinsicLogicalWidthsForColumns(minLogicalWidth, maxLogicalWidth);
if (isTableCell()) {
Length tableCellWidth = toLayoutTableCell(this)->styleOrColLogicalWidth();
@@ -3041,8 +3045,9 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
RenderBlock* containingBlock = this->containingBlock();
LayoutUnit floatLeftWidth = 0, floatRightWidth = 0;
while (child) {
- // Positioned children don't affect the min/max width
- if (child->isOutOfFlowPositioned()) {
+ // Positioned children don't affect the min/max width. Spanners only affect the min/max
+ // width of the multicol container, not the flow thread.
+ if (child->isOutOfFlowPositioned() || child->isColumnSpanAll()) {
child = child->nextSibling();
continue;
}
@@ -3083,6 +3088,12 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
} else {
childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
+ if (child->isRenderFlowThread()) {
+ // The preferred intrinsic widths that a flow thread reports pertains to the column
+ // width, but here we want the preferred multicol container width, so we need to
+ // adjust with that in mind.
+ adjustIntrinsicLogicalWidthsForColumns(childMinPreferredLogicalWidth, childMaxPreferredLogicalWidth);
+ }
}
LayoutUnit w = childMinPreferredLogicalWidth + margin;

Powered by Google App Engine
This is Rietveld 408576698