Chromium Code Reviews| Index: Source/core/rendering/RenderFlexibleBox.cpp |
| diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp |
| index 3a948cb7201ad76ee5b9b8a7be06f21007b20e34..ca0c8e4eb2ae074010d3d66784bda7595f471a33 100644 |
| --- a/Source/core/rendering/RenderFlexibleBox.cpp |
| +++ b/Source/core/rendering/RenderFlexibleBox.cpp |
| @@ -612,7 +612,7 @@ bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout(Render |
| LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox& child, bool hasInfiniteLineLength, bool relayoutChildren) |
| { |
| - child.clearOverrideSize(); |
| + clearLogicalOverrideSize(child); |
| if (child.style()->hasAspectRatio() || child.isImage() || child.isVideo() || child.isCanvas()) |
| UseCounter::count(document(), UseCounter::AspectRatioFlexItem); |
| @@ -994,6 +994,14 @@ void RenderFlexibleBox::setLogicalOverrideSize(RenderBox& child, LayoutUnit chil |
| child.setOverrideLogicalContentWidth(childPreferredSize - child.borderAndPaddingLogicalWidth()); |
| } |
| +void RenderFlexibleBox::clearLogicalOverrideSize(RenderBox& child) |
| +{ |
| + if (hasOrthogonalFlow(child)) |
| + child.clearOverrideLogicalContentHeight(); |
| + else |
| + child.clearOverrideLogicalContentWidth(); |
| +} |
| + |
| void RenderFlexibleBox::prepareChildForPositionedLayout(RenderBox& child, LayoutUnit mainAxisOffset, LayoutUnit crossAxisOffset, PositionedLayoutMode layoutMode) |
| { |
| ASSERT(child.isOutOfFlowPositioned()); |
| @@ -1356,7 +1364,7 @@ void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox& child, LayoutUni |
| LayoutUnit desiredLogicalHeight = child.constrainLogicalHeightByMinMax(stretchedLogicalHeight, heightBeforeStretching - child.borderAndPaddingLogicalHeight()); |
| // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905. |
| - if (desiredLogicalHeight != child.logicalHeight()) { |
| + if (!child.hasOverrideHeight() || ((desiredLogicalHeight - child.borderAndPaddingLogicalHeight()) != child.overrideLogicalContentHeight())) { |
|
cbiesinger
2014/09/25 00:50:31
I think you have to *also* keep desiredLogicalHeig
harpreet.sk
2014/09/25 12:58:57
Done.
|
| child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight()); |
| child.setLogicalHeight(0); |
| child.forceChildLayout(); |