Chromium Code Reviews| 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 3bc1709ebb82d41630deda811a4c8265d7b1c927..66abd7c373716585217e30a28af175389d6e555a 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| @@ -2099,8 +2099,13 @@ void LayoutBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues) |
| computedValues.m_extent = constrainLogicalWidthByMinMax(minPreferredLogicalWidth(), containerLogicalWidth, cb); |
| } else { |
| LayoutUnit containerWidthInInlineDirection = containerLogicalWidth; |
| - if (hasPerpendicularContainingBlock) |
| + if (hasPerpendicularContainingBlock) { |
| containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight(); |
| + } else if (styleToUse.logicalWidth().hasPercent() && !isOutOfFlowPositioned() && cb->isFlexItem()) { |
|
leviw_travelin_and_unemployed
2016/03/01 01:58:51
Nit, I may have put the isFlexItem() part first.
cbiesinger
2016/03/01 20:36:10
Done.
|
| + LayoutUnit stretchedWidth = toLayoutFlexibleBox(cb->parent())->childLogicalHeightForPercentageResolution(*cb); |
|
leviw_travelin_and_unemployed
2016/03/01 01:58:51
Link to spec about why width = height?
cbiesinger
2016/03/01 20:36:10
That was a typo :(
I added a test that hits this
|
| + if (stretchedWidth != LayoutUnit(-1)) |
| + containerWidthInInlineDirection = stretchedWidth; |
| + } |
| LayoutUnit preferredWidth = computeLogicalWidthUsing(MainOrPreferredSize, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb); |
| computedValues.m_extent = constrainLogicalWidthByMinMax(preferredWidth, containerWidthInInlineDirection, cb); |
| } |
| @@ -2600,8 +2605,14 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const |
| bool includeBorderPadding = isTable(); |
| + LayoutUnit stretchedFlexHeight(-1); |
| + if (cb->isFlexItem()) |
| + stretchedFlexHeight = toLayoutFlexibleBox(cb->parent())->childLogicalHeightForPercentageResolution(*cb); |
| + |
| if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { |
| availableHeight = containingBlockChild->containingBlockLogicalWidthForContent(); |
| + } else if (stretchedFlexHeight != LayoutUnit(-1)) { |
| + availableHeight = stretchedFlexHeight; |
| } else if (hasOverrideContainingBlockLogicalHeight()) { |
| availableHeight = overrideContainingBlockContentLogicalHeight(); |
| } else if (cb->isTableCell()) { |