Chromium Code Reviews| 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, |
| + // 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()) { |
|
Julien - ping for review
2015/01/26 14:50:13
This looks nasty. Why don't we patch the flow thre
mstensho (USE GERRIT)
2015/01/26 16:45:15
I did this because I felt that providing the prefe
|
| + // 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; |