[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 Review URL: https://codereview.chromium.org/314993002 git-svn-id: svn://svn.chromium.org/blink/trunk@175886 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment