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

Issue 2654533003: [css-grid] Move the track sizing algorithm to its own class (Closed)

Created:
3 years, 11 months ago by svillar
Modified:
3 years, 10 months ago
CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, Manuel Rego, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, svillar, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[css-grid] Move the track sizing algorithm to its own class This is about moving the track sizing algorithm code out of LayoutGrid to a new class GridTrackSizingAlgorithm, making the LayoutGrid more compact and easy to use. A side effect of this patch is the removal of GridSizingData as it is no longer needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm as attribute members. The algorithm execution starts with the call to run(). It's mandatory to call setup() before any call to run() in order to properly configure the behaviour of the algorithm. You can call setup() & run() multiple times for a single layout operation (normally twice, one for columns and another one for rows). The algorithm uses an state machine to verify that the client issues the calls in the proper order (i.e. first columns and then rows). After finishing the layout, the client should call reset() to allow the algorithm to perform cleanups and to prepare itself for another round of calls. In order to implement the different behaviours of the algorithm depending on whether the available size is definite or not, a strategy pattern was implemented in the GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and another one for indefinite ones. BUG=687184 Review-Url: https://codereview.chromium.org/2654533003 Cr-Commit-Position: refs/heads/master@{#447489} Committed: https://chromium.googlesource.com/chromium/src/+/4cb3f97bf30b086d273330d03c92fcc8b6ea7070

Patch Set 1 #

Total comments: 63

Patch Set 2 : Changes after reviews #

Patch Set 3 : Changes after review #

Patch Set 4 : Build fixes #

Total comments: 15

Patch Set 5 : Build fix #

Total comments: 2

Patch Set 6 : Patch for landing #

Patch Set 7 : Win build fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2211 lines, -1872 lines) Patch
M third_party/WebKit/Source/core/layout/BUILD.gn View 1 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/layout/Grid.h View 1 2 3 4 5 1 chunk +135 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/layout/Grid.cpp View 1 2 3 1 chunk +238 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.h View 1 2 3 4 5 6 1 chunk +270 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp View 1 2 3 4 5 1 chunk +1434 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.h View 1 8 chunks +27 lines, -216 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 2 3 4 29 chunks +103 lines, -1656 lines 0 comments Download

Messages

Total messages: 22 (10 generated)
svillar
Sending out for review. Although the patch is huge, not the most of it is ...
3 years, 11 months ago (2017-01-24 09:49:43 UTC) #1
jfernandez
LGTM https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.h File third_party/WebKit/Source/core/layout/Grid.h (right): https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.h#newcode13 third_party/WebKit/Source/core/layout/Grid.h:13: typedef Vector<LayoutBox*, 1> GridCell; Can those LayoutBox pointer ...
3 years, 10 months ago (2017-01-30 08:48:49 UTC) #4
svillar
Many thanks for the review https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.h File third_party/WebKit/Source/core/layout/Grid.h (right): https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.h#newcode13 third_party/WebKit/Source/core/layout/Grid.h:13: typedef Vector<LayoutBox*, 1> GridCell; ...
3 years, 10 months ago (2017-01-30 09:35:45 UTC) #5
Manuel Rego
First one question, is this a single CL or it'd be a bunch of them? ...
3 years, 10 months ago (2017-01-30 11:00:46 UTC) #6
svillar
Thanks for the review! https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.cpp File third_party/WebKit/Source/core/layout/Grid.cpp (right): https://codereview.chromium.org/2654533003/diff/1/third_party/WebKit/Source/core/layout/Grid.cpp#newcode61 third_party/WebKit/Source/core/layout/Grid.cpp:61: return m_gridItemsIndexesMap.get(&item); On 2017/01/30 11:00:45, ...
3 years, 10 months ago (2017-01-30 11:28:29 UTC) #7
svillar
Applied the suggested changes. I also refactored minContentForChild, maxContentForChild and minSizeForChild in the parent class. ...
3 years, 10 months ago (2017-01-30 15:59:51 UTC) #8
Manuel Rego
LGTM. But I insist I'd report a bug and I'd explain there the new classes ...
3 years, 10 months ago (2017-01-31 09:37:10 UTC) #9
svillar
OK, I'll open a bug then https://codereview.chromium.org/2654533003/diff/60001/third_party/WebKit/Source/core/layout/Grid.h File third_party/WebKit/Source/core/layout/Grid.h (right): https://codereview.chromium.org/2654533003/diff/60001/third_party/WebKit/Source/core/layout/Grid.h#newcode27 third_party/WebKit/Source/core/layout/Grid.h:27: // by a ...
3 years, 10 months ago (2017-01-31 10:03:12 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2654533003/120001
3 years, 10 months ago (2017-01-31 15:52:09 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/381187)
3 years, 10 months ago (2017-01-31 18:36:06 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2654533003/120001
3 years, 10 months ago (2017-02-01 09:23:33 UTC) #19
commit-bot: I haz the power
3 years, 10 months ago (2017-02-01 12:08:00 UTC) #22
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/4cb3f97bf30b086d273330d03c92...

Powered by Google App Engine
This is Rietveld 408576698