| Index: Source/core/layout/LayoutGrid.cpp
|
| diff --git a/Source/core/layout/LayoutGrid.cpp b/Source/core/layout/LayoutGrid.cpp
|
| index 56826d06c9350e129bc8fc841290ceabc90320d6..d985a6d6cc7f73b3d759f2359c718d24800e289e 100644
|
| --- a/Source/core/layout/LayoutGrid.cpp
|
| +++ b/Source/core/layout/LayoutGrid.cpp
|
| @@ -618,10 +618,13 @@ LayoutUnit LayoutGrid::logicalHeightForChild(LayoutBox& child, Vector<GridTrack>
|
| LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
|
| if (child.hasRelativeLogicalHeight() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth) {
|
| layoutScope.setNeedsLayout(&child, LayoutInvalidationReason::GridChanged);
|
| - // We need to clear the stretched height to properly compute logical height during layout.
|
| - child.clearOverrideLogicalContentHeight();
|
| }
|
|
|
| + bool hasOverrideHeight = child.hasOverrideLogicalContentHeight();
|
| + // We need to clear the stretched height to properly compute logical height during layout.
|
| + if (hasOverrideHeight && child.needsLayout())
|
| + child.clearOverrideLogicalContentHeight();
|
| +
|
| child.setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
|
| // If |child| has a relative logical height, we shouldn't let it override its intrinsic height, which is
|
| // what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution).
|
| @@ -629,7 +632,7 @@ LayoutUnit LayoutGrid::logicalHeightForChild(LayoutBox& child, Vector<GridTrack>
|
| child.setOverrideContainingBlockContentLogicalHeight(-1);
|
| child.layoutIfNeeded();
|
| // If the child was stretched we should use its intrinsic height.
|
| - return (child.hasOverrideLogicalContentHeight() ? childIntrinsicHeight(child) : child.logicalHeight()) + child.marginLogicalHeight();
|
| + return (hasOverrideHeight ? childIntrinsicHeight(child) : child.logicalHeight()) + child.marginLogicalHeight();
|
| }
|
|
|
| LayoutUnit LayoutGrid::minSizeForChild(LayoutBox& child, GridTrackSizingDirection direction, Vector<GridTrack>& columnTracks)
|
|
|