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

Issue 2033033002: [css-grid] Percentage columns can always be resolved during layout (Closed)

Created:
4 years, 6 months ago by Manuel Rego
Modified:
4 years, 6 months ago
CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, svillar, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, jchaffraix+rendering, blink-reviews, eae+blinkwatch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[css-grid] Percentage columns can always be resolved during layout The issue is that the inline size of the grid container is only indefinite while we're computing the intrinsic sizes. During layout we should be able to resolve the percentage tracks against that size. This makes Grid Layout compatible with regular blocks regarding how inline percentages are resolved. The patch passes the SizingOperation enum to LayoutGrid::gridTrackSize(). That way we can know if we're computing the intrinsic sizes or not. It also gets rid of LayoutBox::hasDefiniteLogicalWidth() as it was wrong and not needed actually. Created a new test verifying the expected behavior. Updated the results in a few tests too. BUG=616716 TEST=fast/css-grid-layout/grid-container-percentage-columns.html Committed: https://crrev.com/3043a48f261b5d1b4f175a2a8f2373ac22ae41f1 Cr-Commit-Position: refs/heads/master@{#398535}

Patch Set 1 #

Patch Set 2 : New version using SizingOperation enum #

Total comments: 4

Patch Set 3 : Rebased version after https://codereview.chromium.org/2030803003/ #

Patch Set 4 : Remove hasDefiniteLogicalSize() #

Patch Set 5 : Get rid of hasDefiniteLogicalWidth() #

Total comments: 8

Patch Set 6 : Minor fixes on tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+298 lines, -79 lines) Patch
M third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-columns.html View 1 2 3 4 5 1 chunk +257 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/named-grid-line-get-set.html View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/named-grid-line-get-set-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/percent-track-breadths-regarding-container-size.html View 1 2 3 4 5 2 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 1 chunk +0 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.h View 1 2 3 3 chunks +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 2 3 12 chunks +19 lines, -26 lines 0 comments Download

Messages

Total messages: 21 (7 generated)
Manuel Rego
4 years, 6 months ago (2016-06-02 11:50:36 UTC) #2
Manuel Rego
I've just realized that AvailableSpaceType is kind of duplicated: https://codereview.chromium.org/2030803003/ I'll do a new version ...
4 years, 6 months ago (2016-06-02 14:04:37 UTC) #3
Manuel Rego
Uploaded new version, on top of this patch: https://codereview.chromium.org/2030803003/ The new version use SizingOperation enum.
4 years, 6 months ago (2016-06-02 14:41:27 UTC) #4
jfernandez
non-owner LGTM, but let's fix some typos in the issue description: The patch pass -> ...
4 years, 6 months ago (2016-06-02 21:58:28 UTC) #5
Manuel Rego
Thanks for the review. Fixed the description. https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode816 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:816: LayoutUnit marginLogicalWidth ...
4 years, 6 months ago (2016-06-03 07:09:06 UTC) #7
jfernandez
https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode816 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:816: LayoutUnit marginLogicalWidth = sizingData.sizingOperation == TrackSizing ? computeMarginLogicalSizeForChild(InlineDirection, child) ...
4 years, 6 months ago (2016-06-03 07:20:58 UTC) #8
Manuel Rego
https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp File third_party/WebKit/Source/core/layout/LayoutGrid.cpp (right): https://codereview.chromium.org/2033033002/diff/20001/third_party/WebKit/Source/core/layout/LayoutGrid.cpp#newcode816 third_party/WebKit/Source/core/layout/LayoutGrid.cpp:816: LayoutUnit marginLogicalWidth = sizingData.sizingOperation == TrackSizing ? computeMarginLogicalSizeForChild(InlineDirection, child) ...
4 years, 6 months ago (2016-06-03 08:56:14 UTC) #9
cbiesinger
lgtm
4 years, 6 months ago (2016-06-06 22:03:10 UTC) #10
Manuel Rego
Thanks for the reviews! I'd like that @svillar takes a look anyway, as he was ...
4 years, 6 months ago (2016-06-07 08:00:11 UTC) #11
svillar
Code lgtm but some changes in the tests do not seem good to me https://codereview.chromium.org/2033033002/diff/80001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt ...
4 years, 6 months ago (2016-06-08 10:38:04 UTC) #13
Manuel Rego
Thanks for the reviews. What do we do with the decimals then? https://codereview.chromium.org/2033033002/diff/80001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt ...
4 years, 6 months ago (2016-06-08 11:56:30 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2033033002/100001
4 years, 6 months ago (2016-06-08 12:04:46 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 6 months ago (2016-06-08 13:34:20 UTC) #19
commit-bot: I haz the power
4 years, 6 months ago (2016-06-08 13:37:49 UTC) #21
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/3043a48f261b5d1b4f175a2a8f2373ac22ae41f1
Cr-Commit-Position: refs/heads/master@{#398535}

Powered by Google App Engine
This is Rietveld 408576698