Chromium Code Reviews| Index: Source/core/layout/LayoutGrid.cpp |
| diff --git a/Source/core/layout/LayoutGrid.cpp b/Source/core/layout/LayoutGrid.cpp |
| index 8138448479b41f703647d28533068f7a7e3a3f61..971da5fba8c3b9b5dba0d4057469a5474f02da11 100644 |
| --- a/Source/core/layout/LayoutGrid.cpp |
| +++ b/Source/core/layout/LayoutGrid.cpp |
| @@ -1569,25 +1569,26 @@ LayoutUnit LayoutGrid::availableAlignmentSpaceForChildBeforeStretching(LayoutUni |
| // FIXME: This logic is shared by LayoutFlexibleBox, so it should be moved to LayoutBox. |
| void LayoutGrid::applyStretchAlignmentToChildIfNeeded(LayoutBox& child, LayoutUnit gridAreaBreadthForChild) |
| { |
| - if (ComputedStyle::resolveAlignment(styleRef(), child.styleRef(), ItemPositionStretch) != ItemPositionStretch) |
| + if (!allowedToStretchLogicalHeightForChild(child) || ComputedStyle::resolveAlignment(styleRef(), child.styleRef(), ItemPositionStretch) != ItemPositionStretch) { |
| + if (child.hasOverrideLogicalContentHeight()) |
|
Julien - ping for review
2015/06/03 21:33:13
I would just call clearOverrideLogicalContentHeigh
jfernandez
2015/06/05 00:05:30
Done.
|
| + child.clearOverrideLogicalContentHeight(); |
|
Julien - ping for review
2015/06/03 21:33:13
Thinking out loud here, we should probably think a
jfernandez
2015/06/05 00:05:30
Yes, I've got the same feeling. I'll add t my TODO
|
| return; |
| + } |
| bool hasOrthogonalWritingMode = child.isHorizontalWritingMode() != isHorizontalWritingMode(); |
| - if (allowedToStretchLogicalHeightForChild(child)) { |
| - // FIXME: If the child has orthogonal flow, then it already has an override height set, so use it. |
| - // FIXME: grid track sizing and positioning do not support orthogonal modes yet. |
| - if (!hasOrthogonalWritingMode) { |
| - LayoutUnit stretchedLogicalHeight = availableAlignmentSpaceForChildBeforeStretching(gridAreaBreadthForChild, child); |
| - LayoutUnit desiredLogicalHeight = child.constrainLogicalHeightByMinMax(stretchedLogicalHeight, -1); |
| - |
| - // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905. |
| - bool childNeedsRelayout = desiredLogicalHeight != child.logicalHeight(); |
| - if (childNeedsRelayout || !child.hasOverrideLogicalContentHeight()) |
| - child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight()); |
| - if (childNeedsRelayout) { |
| - child.setLogicalHeight(0); |
| - child.setNeedsLayout(LayoutInvalidationReason::GridChanged); |
| - } |
| + // FIXME: If the child has orthogonal flow, then it already has an override height set, so use it. |
| + // FIXME: grid track sizing and positioning do not support orthogonal modes yet. |
| + if (!hasOrthogonalWritingMode) { |
| + LayoutUnit stretchedLogicalHeight = availableAlignmentSpaceForChildBeforeStretching(gridAreaBreadthForChild, child); |
| + LayoutUnit desiredLogicalHeight = child.constrainLogicalHeightByMinMax(stretchedLogicalHeight, -1); |
| + |
| + // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905. |
| + bool childNeedsRelayout = desiredLogicalHeight != child.logicalHeight(); |
| + if (childNeedsRelayout || !child.hasOverrideLogicalContentHeight()) |
| + child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight()); |
| + if (childNeedsRelayout) { |
| + child.setLogicalHeight(0); |
| + child.setNeedsLayout(LayoutInvalidationReason::GridChanged); |
| } |
| } |
| } |