| Index: third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
|
| index 3ff751250ed90084af9f35773ab0d64329f5831c..4740e44191213d586d177f5271cd317bbf4987ef 100644
|
| --- a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
|
| @@ -287,15 +287,10 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::LogicalHeightForChild(
|
| child.ClearOverrideLogicalContentHeight();
|
|
|
| child.LayoutIfNeeded();
|
| - GridAxis baseline_axis = GetLayoutGrid()->IsOrthogonalChild(child)
|
| - ? kGridRowAxis
|
| - : kGridColumnAxis;
|
| - if (GetLayoutGrid()->IsBaselineAlignmentForChild(child, baseline_axis) &&
|
| - GetLayoutGrid()->IsBaselineContextComputed(baseline_axis)) {
|
| - auto& group =
|
| - GetLayoutGrid()->GetBaselineGroupForChild(child, baseline_axis);
|
| - return group.MaxAscent() + group.MaxDescent();
|
| - }
|
| +
|
| + if (auto baseline_extent = ExtentForBaselineAlignment(child))
|
| + return baseline_extent.value();
|
| +
|
| return child.LogicalHeight() + child.MarginLogicalHeight();
|
| }
|
|
|
| @@ -326,12 +321,8 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::MinContentForChild(
|
|
|
| if (Direction() == kForColumns && !AvailableSpace()) {
|
| DCHECK(GetLayoutGrid()->IsOrthogonalChild(child));
|
| - if (GetLayoutGrid()->IsBaselineAlignmentForChild(child, kGridRowAxis) &&
|
| - GetLayoutGrid()->IsBaselineContextComputed(kGridRowAxis)) {
|
| - auto& group =
|
| - GetLayoutGrid()->GetBaselineGroupForChild(child, kGridRowAxis);
|
| - return group.MaxAscent() + group.MaxDescent();
|
| - }
|
| + if (auto baseline_extent = ExtentForBaselineAlignment(child))
|
| + return baseline_extent.value();
|
| }
|
|
|
| if (UpdateOverrideContainingBlockContentSizeForChild(child,
|
| @@ -430,6 +421,20 @@ void GridTrackSizingAlgorithmStrategy::DistributeSpaceToTracks(
|
| available_logical_space);
|
| }
|
|
|
| +Optional<LayoutUnit>
|
| +GridTrackSizingAlgorithmStrategy::ExtentForBaselineAlignment(
|
| + LayoutBox& child) const {
|
| + auto grid = algorithm_.layout_grid_;
|
| + GridAxis baseline_axis =
|
| + grid->IsOrthogonalChild(child) ? kGridRowAxis : kGridColumnAxis;
|
| + if (!grid->IsBaselineAlignmentForChild(child, baseline_axis) ||
|
| + !grid->IsBaselineContextComputed(baseline_axis))
|
| + return WTF::kNullopt;
|
| +
|
| + auto& group = grid->GetBaselineGroupForChild(child, baseline_axis);
|
| + return group.MaxAscent() + group.MaxDescent();
|
| +}
|
| +
|
| LayoutUnit DefiniteSizeStrategy::MinLogicalWidthForChild(
|
| LayoutBox& child,
|
| Length child_min_size,
|
|
|