Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 314993002: [CSS Grid Layout] Fix auto-placement algorithm (Closed)

Created:
6 years, 6 months ago by Manuel Rego
Modified:
6 years, 6 months ago
CC:
blink-reviews, jfernandez, blink-reviews-rendering, zoltan1, svillar, Manuel Rego, leviw+renderwatch, eae+blinkwatch, jchaffraix+rendering, pdr., rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -0 lines) Patch
M LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html View 1 2 chunks +34 lines, -0 lines 0 comments Download
M LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span-expected.txt View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderGrid.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Manuel Rego
6 years, 6 months ago (2014-06-04 09:37:44 UTC) #1
svillar
Please check the wording of the description. https://codereview.chromium.org/314993002/diff/1/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (right): https://codereview.chromium.org/314993002/diff/1/Source/core/rendering/RenderGrid.cpp#newcode937 Source/core/rendering/RenderGrid.cpp:937: emptyGridArea = ...
6 years, 6 months ago (2014-06-04 09:48:23 UTC) #2
Manuel Rego
Fixed description, I hope it's clearer now. https://codereview.chromium.org/314993002/diff/1/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (right): https://codereview.chromium.org/314993002/diff/1/Source/core/rendering/RenderGrid.cpp#newcode937 Source/core/rendering/RenderGrid.cpp:937: emptyGridArea = ...
6 years, 6 months ago (2014-06-04 10:02:52 UTC) #3
Julien - ping for review
lgtm https://codereview.chromium.org/314993002/diff/1/LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html File LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html (right): https://codereview.chromium.org/314993002/diff/1/LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html#newcode92 LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html:92: </div> I would have added an extra test ...
6 years, 6 months ago (2014-06-10 00:08:05 UTC) #4
Manuel Rego
Thanks for the review. I'm uploading a modified version of the patch for landing. https://codereview.chromium.org/314993002/diff/1/LayoutTests/fast/css-grid-layout/grid-item-auto-placement-automatic-span.html ...
6 years, 6 months ago (2014-06-10 09:49:02 UTC) #5
Manuel Rego
The CQ bit was checked by rego@igalia.com
6 years, 6 months ago (2014-06-10 09:49:23 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rego@igalia.com/314993002/20001
6 years, 6 months ago (2014-06-10 09:50:16 UTC) #7
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 6 months ago (2014-06-10 10:57:12 UTC) #8
commit-bot: I haz the power
6 years, 6 months ago (2014-06-10 11:32:00 UTC) #9
Message was sent while issue was closed.
Change committed as 175886

Powered by Google App Engine
This is Rietveld 408576698