Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
index 4a4f729789e74e74629b83a48ea724f4c655a1f7..b93226f6e35bab58ec73eb9979095fdaf898a044 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -2040,17 +2040,18 @@ void LayoutBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues) |
return; |
} |
+ LayoutUnit containerWidthInInlineDirection = containerLogicalWidth; |
+ if (hasPerpendicularContainingBlock) |
+ containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight(); |
+ |
// Width calculations |
if (treatAsReplaced) { |
computedValues.m_extent = logicalWidthLength.value() + borderAndPaddingLogicalWidth(); |
- } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && style()->logicalMinWidth().isAuto() && style()->overflowX() == OVISIBLE && containerLogicalWidth < minPreferredLogicalWidth()) { |
+ } else if (parent()->isLayoutGrid() && style()->logicalWidth().isAuto() && style()->logicalMinWidth().isAuto() && style()->overflowX() == OVISIBLE && containerWidthInInlineDirection < minPreferredLogicalWidth()) { |
// TODO (lajava) Move this logic to the LayoutGrid class. |
// Implied minimum size of Grid items. |
- computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogicalWidth(), containerLogicalWidth, cb); |
+ computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogicalWidth(), containerWidthInInlineDirection, cb); |
} else { |
- LayoutUnit containerWidthInInlineDirection = containerLogicalWidth; |
- if (hasPerpendicularContainingBlock) |
- containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight(); |
LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb); |
computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth, containerWidthInInlineDirection, cb); |
} |