Description[CSS Grid Layout] Fix auto-placement algorithm
In RenderGrid::placeAutoMajorAxisItemOnGrid if the empty grid area does
not fit in the minor axis direction we should discard it. That way we
will avoid to grow in that direction at this moment, as this was
previously done at RenderGrid::populateExplicitGridAndOrderIterator().
A simple use case to reproduce the problem would be a 2x2 grid with
grid-auto-flow property set to "row", where the only empty cell is at
row 2 and column 2. If you try to place an item with the following
properties:
grid-row: auto;
grid-column: span 2;
It should be inserted in a new row, however before this patch it was
inserted at row 2 using columns 2 and 3. As even when the empty grid
area does not fit in the minor axis direction, it was still being used
later to insert the item.
Updated layout test to include similar cases that don't work without
this patch.
BUG=353789
TEST=fast/css-grid-layout/grid-item-auto-placement-automatic-span.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175886
Patch Set 1 #
Total comments: 8
Patch Set 2 : Patch for landing #
Messages
Total messages: 9 (0 generated)
|