Chromium Code Reviews| 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 a34960d16c5496f9514bb0a222be58472a526579..a4a1cb96327215aeaa545ba88d61001c9e98a5b6 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
| @@ -453,7 +453,6 @@ void LayoutGrid::layoutBlock(bool relayoutChildren) |
| LayoutSize previousSize = size(); |
| updateLogicalWidth(); |
| - bool logicalHeightWasIndefinite = !hasDefiniteLogicalHeight(); |
| TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); |
| @@ -475,7 +474,7 @@ void LayoutGrid::layoutBlock(bool relayoutChildren) |
| // 2- Next, the track sizing algorithm resolves the sizes of the grid rows, using the |
| // grid column sizes calculated in the previous step. |
| - if (logicalHeightWasIndefinite) |
| + if (!hasDefiniteLogicalHeight()) |
| computeIntrinsicLogicalHeight(sizingData); |
| else |
| computeTrackSizesForDirection(ForRows, sizingData, availableLogicalHeight(ExcludeMarginBorderPadding)); |
| @@ -484,16 +483,10 @@ void LayoutGrid::layoutBlock(bool relayoutChildren) |
| LayoutUnit oldClientAfterEdge = clientLogicalBottom(); |
| updateLogicalHeight(); |
| - // The above call might have changed the grid's logical height depending on min|max height restrictions. |
| - // Update the sizes of the rows whose size depends on the logical height (also on definite|indefinite sizes). |
| - LayoutUnit availableSpaceForRows = contentLogicalHeight(); |
| - if (logicalHeightWasIndefinite) |
| - computeTrackSizesForDirection(ForRows, sizingData, availableSpaceForRows); |
| - |
| // 3- If the min-content contribution of any grid items have changed based on the row |
| // sizes calculated in step 2, steps 1 and 2 are repeated with the new min-content |
| // contribution (once only). |
| - repeatTracksSizingIfNeeded(sizingData, availableSpaceForColumns, availableSpaceForRows); |
| + repeatTracksSizingIfNeeded(sizingData, availableSpaceForColumns, contentLogicalHeight()); |
| // Grid container should have the minimum height of a line if it's editable. That doesn't affect track sizing though. |
| if (hasLineIfEmpty()) |
| @@ -623,6 +616,7 @@ void LayoutGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo |
| void LayoutGrid::computeIntrinsicLogicalHeight(GridSizingData& sizingData) |
| { |
| + DCHECK(sizingData.isValidTransition(ForRows)); |
| ASSERT(tracksAreWiderThanMinTrackBreadth(ForColumns, sizingData)); |
| sizingData.setAvailableSpace(LayoutUnit()); |
| sizingData.freeSpace(ForRows) = LayoutUnit(); |
| @@ -634,6 +628,7 @@ void LayoutGrid::computeIntrinsicLogicalHeight(GridSizingData& sizingData) |
| m_maxContentHeight += totalGuttersSize; |
| ASSERT(tracksAreWiderThanMinTrackBreadth(ForRows, sizingData)); |
| + sizingData.nextState(); |
|
jfernandez
2016/09/14 21:54:46
It's a bit confusing/peculiar that intrinsic size
|
| } |
| LayoutUnit LayoutGrid::computeIntrinsicLogicalContentHeightUsing(const Length& logicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPadding) const |
| @@ -1895,6 +1890,7 @@ void LayoutGrid::applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection |
| void LayoutGrid::layoutGridItems(GridSizingData& sizingData) |
| { |
| + sizingData.sizingOperation = TrackSizing; |
|
jfernandez
2016/09/14 21:54:46
Why we need to do this ? Wouldn't be better place
svillar
2016/09/15 10:04:34
We need this because the layout of the items invol
|
| populateGridPositionsForDirection(sizingData, ForColumns); |
| populateGridPositionsForDirection(sizingData, ForRows); |
| m_gridItemsOverflowingGridArea.resize(0); |