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

Issue 148293008: [CSS Grid Layout] Add support to place items using named grid lines (Closed)

Created:
6 years, 10 months ago by svillar
Modified:
6 years, 7 months ago
CC:
blink-reviews, dglazkov+blink, apavlov+blink_chromium.org, ed+blinkwatch_opera.com, darktears
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

[CSS Grid Layout] Add support to place items using named grid lines Currently our code assumes that a <custom-ident> in grid-{column|row}-{start|end} and grid-{column|row} is always a grid area. That's wrong because the <custom-ident> could be also a explicitly named grid line. Our resolution code is not correct either. This patch fixes it so it now matches the spec which means that: * first we try to match any existing grid area. * if there is a named grid line with the name <custom-ident>-{start|end} for grid-{column|row}-{start|end} defined before the grid area then we use it instead of the grid area. * otherwise if there is a named grid line we resolve to the first such line. * otherwise we treat it as 'auto'. BUG=337779 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174021

Patch Set 1 #

Total comments: 13

Patch Set 2 : Applied Julien's suggestions #

Patch Set 3 : Back to smart pointers #

Patch Set 4 : Improved readability of adjustNamedGridItemPosition #

Total comments: 2

Patch Set 5 : New approach #

Total comments: 3

Patch Set 6 : Refactored code and added comments #

Patch Set 7 : Added some more test cases for special grid area names #

Total comments: 4

Patch Set 8 : Create implicit lines in StyleBuilder #

Patch Set 9 : Rebased patch #

Total comments: 14

Patch Set 10 : Implementation following specs #

Total comments: 3

Patch Set 11 : Patch for landing #

Patch Set 12 : Patch for landing v2. Rebased #

Patch Set 13 : Patch for landing v3. Fix for Debug bot #

Unified diffs Side-by-side diffs Delta from patch set Stats (+472 lines, -24 lines) Patch
A LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +155 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
A LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html View 1 2 3 4 5 6 7 1 chunk +243 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -3 lines 0 comments Download
M Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleBuilderConverter.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/resolver/StyleBuilderConverter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +18 lines, -1 line 0 comments Download
M Source/core/css/resolver/StyleBuilderCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -1 line 0 comments Download
M Source/core/rendering/style/GridCoordinate.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +16 lines, -0 lines 0 comments Download
M Source/core/rendering/style/GridResolvedPosition.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +25 lines, -17 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
svillar
ping :)
6 years, 10 months ago (2014-02-10 10:32:58 UTC) #1
Julien - ping for review
https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp#newcode396 Source/core/css/resolver/StyleAdjuster.cpp:396: const GridCoordinate gridAreaCoordinates = gridAreaMap.get(gridAreaName); It should be a ...
6 years, 10 months ago (2014-02-12 21:55:30 UTC) #2
svillar
https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp#newcode396 Source/core/css/resolver/StyleAdjuster.cpp:396: const GridCoordinate gridAreaCoordinates = gridAreaMap.get(gridAreaName); On 2014/02/12 21:55:31, Julien ...
6 years, 10 months ago (2014-02-13 10:13:39 UTC) #3
Julien - ping for review
https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp#newcode424 Source/core/css/resolver/StyleAdjuster.cpp:424: const bool hasEndSuffix = namedGridAreaOrGridLine.endsWith("-end"); On 2014/02/13 10:13:39, svillar ...
6 years, 10 months ago (2014-02-13 19:32:00 UTC) #4
svillar
Damn, looks like I had totally forgotten to send the comments. https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): ...
6 years, 10 months ago (2014-02-24 16:44:31 UTC) #5
svillar
Applied Julien's suggestions
6 years, 9 months ago (2014-02-27 18:12:33 UTC) #6
svillar
https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/148293008/diff/1/Source/core/css/resolver/StyleAdjuster.cpp#newcode420 Source/core/css/resolver/StyleAdjuster.cpp:420: OwnPtr<GridPosition> adjustedPosition; On 2014/02/12 21:55:31, Julien Chaffraix - PST ...
6 years, 9 months ago (2014-02-28 17:37:13 UTC) #7
Julien - ping for review
https://codereview.chromium.org/148293008/diff/130001/Source/core/css/resolver/StyleAdjuster.cpp File Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/148293008/diff/130001/Source/core/css/resolver/StyleAdjuster.cpp#newcode415 Source/core/css/resolver/StyleAdjuster.cpp:415: bool isStartSide = side == ColumnStartSide || side == ...
6 years, 9 months ago (2014-03-05 01:12:34 UTC) #8
svillar
On 2014/03/05 01:12:34, Julien Chaffraix - PST wrote: > https://codereview.chromium.org/148293008/diff/130001/Source/core/css/resolver/StyleAdjuster.cpp > File Source/core/css/resolver/StyleAdjuster.cpp (right): > ...
6 years, 9 months ago (2014-03-07 09:43:29 UTC) #9
svillar
Moved the map of grid line names grom the style to the renderer
6 years, 9 months ago (2014-03-17 11:21:15 UTC) #10
Julien - ping for review
The new change looks much better, thanks! https://codereview.chromium.org/148293008/diff/150001/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (left): https://codereview.chromium.org/148293008/diff/150001/Source/core/rendering/RenderGrid.cpp#oldcode1083 Source/core/rendering/RenderGrid.cpp:1083: // 'auto' ...
6 years, 9 months ago (2014-03-20 18:14:41 UTC) #11
svillar
On 2014/03/20 18:14:41, Julien Chaffraix - PST wrote: > The new change looks much better, ...
6 years, 9 months ago (2014-03-24 09:17:49 UTC) #12
svillar
Added some more test cases for special grid area names
6 years, 9 months ago (2014-03-26 17:04:25 UTC) #13
svillar
ping owners :)
6 years, 8 months ago (2014-03-31 17:27:20 UTC) #14
Julien - ping for review
https://codereview.chromium.org/148293008/diff/180001/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (right): https://codereview.chromium.org/148293008/diff/180001/Source/core/rendering/RenderGrid.cpp#newcode250 Source/core/rendering/RenderGrid.cpp:250: } I really don't understand what moving this code ...
6 years, 8 months ago (2014-03-31 23:36:20 UTC) #15
svillar
Thanks for the review. https://codereview.chromium.org/148293008/diff/180001/Source/core/rendering/RenderGrid.cpp File Source/core/rendering/RenderGrid.cpp (right): https://codereview.chromium.org/148293008/diff/180001/Source/core/rendering/RenderGrid.cpp#newcode250 Source/core/rendering/RenderGrid.cpp:250: } On 2014/03/31 23:36:21, Julien ...
6 years, 8 months ago (2014-04-01 08:00:42 UTC) #16
Julien - ping for review
We should just split the reverse map move to a follow-up change as I think ...
6 years, 8 months ago (2014-04-08 16:47:28 UTC) #17
svillar
As agreed, I moved the addition of the implicit lines to the StyleBuilder. Apart from ...
6 years, 8 months ago (2014-04-10 18:35:53 UTC) #18
svillar
On 2014/04/10 18:35:53, svillar wrote: > As agreed, I moved the addition of the implicit ...
6 years, 7 months ago (2014-05-05 14:10:25 UTC) #19
Julien - ping for review
I think we should make our assumptions more in the new code as we are ...
6 years, 7 months ago (2014-05-08 18:48:05 UTC) #20
svillar
Thanks for the review! Unless I'm missing something, I think most of the comments don't ...
6 years, 7 months ago (2014-05-09 11:14:38 UTC) #21
svillar
I take back one of my comments, the "bug" is not a bug, the code ...
6 years, 7 months ago (2014-05-09 14:40:14 UTC) #22
Julien - ping for review
We talked about this with Sergio and the plan forward is to follow the specification ...
6 years, 7 months ago (2014-05-09 17:37:54 UTC) #23
svillar
https://codereview.chromium.org/148293008/diff/220001/Source/core/css/resolver/StyleBuilderCustom.cpp File Source/core/css/resolver/StyleBuilderCustom.cpp (right): https://codereview.chromium.org/148293008/diff/220001/Source/core/css/resolver/StyleBuilderCustom.cpp#newcode1854 Source/core/css/resolver/StyleBuilderCustom.cpp:1854: NamedGridLinesMap namedGridRowLines = state.style()->namedGridRowLines(); On 2014/05/09 17:37:54, Julien Chaffraix ...
6 years, 7 months ago (2014-05-12 10:36:02 UTC) #24
svillar
I finally decided to limit the amount of changes against master so I brought the ...
6 years, 7 months ago (2014-05-12 10:58:09 UTC) #25
Julien - ping for review
lgtm https://codereview.chromium.org/148293008/diff/230001/LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html File LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html (right): https://codereview.chromium.org/148293008/diff/230001/LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html#newcode148 LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html:148: <div>This test checks that.</div> I think you're missing ...
6 years, 7 months ago (2014-05-12 11:42:12 UTC) #26
svillar
The CQ bit was checked by svillar@igalia.com
6 years, 7 months ago (2014-05-12 13:43:10 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svillar@igalia.com/148293008/250001
6 years, 7 months ago (2014-05-12 13:43:16 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-12 13:43:25 UTC) #29
commit-bot: I haz the power
Failed to apply patch for Source/core/css/resolver/StyleBuilderCustom.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 7 months ago (2014-05-12 13:43:26 UTC) #30
svillar
On 2014/05/12 13:43:26, I haz the power (commit-bot) wrote: > Failed to apply patch for ...
6 years, 7 months ago (2014-05-12 14:07:03 UTC) #31
svillar
The CQ bit was checked by svillar@igalia.com
6 years, 7 months ago (2014-05-13 13:49:18 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svillar@igalia.com/148293008/270001
6 years, 7 months ago (2014-05-13 13:49:24 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-13 15:14:00 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-13 16:36:05 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/7350)
6 years, 7 months ago (2014-05-13 16:36:06 UTC) #36
svillar
The CQ bit was checked by svillar@igalia.com
6 years, 7 months ago (2014-05-14 10:12:58 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svillar@igalia.com/148293008/290001
6 years, 7 months ago (2014-05-14 10:13:07 UTC) #38
commit-bot: I haz the power
6 years, 7 months ago (2014-05-14 11:25:38 UTC) #39
Message was sent while issue was closed.
Change committed as 174021

Powered by Google App Engine
This is Rietveld 408576698