| Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
|
| index 957ecad4da47dc281d667cbd7d469519da0556cd..db35ba92f2b5d31b01c74c08c655a59c7c84092a 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
|
| @@ -236,16 +236,16 @@ void LayoutGrid::UpdateBlockLayout(bool relayout_children) {
|
| // We need to clear both own and containingBlock override sizes to
|
| // ensure we get the same result when grid's intrinsic size is
|
| // computed again in the updateLogicalWidth call bellow.
|
| - if (SizesLogicalWidthToFitContent(StyleRef().LogicalWidth()) ||
|
| - StyleRef().LogicalWidth().IsIntrinsicOrAuto()) {
|
| - for (auto* child = FirstInFlowChildBox(); child;
|
| - child = child->NextInFlowSiblingBox()) {
|
| - if (!IsOrthogonalChild(*child))
|
| - continue;
|
| - child->ClearOverrideSize();
|
| - child->ClearContainingBlockOverrideSize();
|
| - child->ForceLayout();
|
| - }
|
| + bool isContentSizedGrid =
|
| + SizesLogicalWidthToFitContent(StyleRef().LogicalWidth()) ||
|
| + StyleRef().LogicalWidth().IsIntrinsicOrAuto();
|
| + for (auto* child = FirstInFlowChildBox(); child;
|
| + child = child->NextInFlowSiblingBox()) {
|
| + child->ClearOverrideSize();
|
| + if (!isContentSizedGrid || !IsOrthogonalChild(*child))
|
| + continue;
|
| + child->ClearContainingBlockOverrideSize();
|
| + child->ForceLayout();
|
| }
|
|
|
| UpdateLogicalWidth();
|
| @@ -1527,11 +1527,6 @@ GridTrackSizingDirection LayoutGrid::FlowAwareDirectionForChild(
|
| // FIXME: This logic is shared by LayoutFlexibleBox, so it should be moved to
|
| // LayoutBox.
|
| void LayoutGrid::ApplyStretchAlignmentToChildIfNeeded(LayoutBox& child) {
|
| - // We clear height override values because we will decide now whether it's
|
| - // allowed or not, evaluating the conditions which might have changed since
|
| - // the old values were set.
|
| - child.ClearOverrideLogicalContentHeight();
|
| -
|
| GridTrackSizingDirection child_block_direction =
|
| FlowAwareDirectionForChild(child, kForRows);
|
| bool block_flow_is_column_axis = child_block_direction == kForRows;
|
|
|