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

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: final 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..b99b8b0cdddd720c373e4d4d5506d200e7f45fff 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 flow thread 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();
@@ -3010,6 +3014,7 @@ void RenderBlock::computePreferredLogicalWidths()
void RenderBlock::adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
+ ASSERT(!document().regionBasedColumnsEnabled());
if (!style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth()) {
// The min/max intrinsic widths calculated really tell how much space elements need when
// laid out inside the columns. In order to eventually end up with the desired column width,
@@ -3041,8 +3046,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;
}

Powered by Google App Engine
This is Rietveld 408576698