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

Issue 2154593003: [css-grid] Fix indefinite height detection (Closed)

Created:
4 years, 5 months ago by Manuel Rego
Modified:
4 years, 3 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] Fix indefinite height detection The change introduced in r398680 was wrong. In that occasion in order to check if the height of an element was indefinite, we were picking the first child and checking if a percentage was resolvable for it. This is not right, for example on a grid container where the first cell has a fixed height, if the first child is in that cell it can resolve a percentage. Thus, we were detecting that the grid container has a definite height when it might not be the case. This patch introduces back a LayoutBlock::hasDefiniteLogicalHeight() reusing the logic from LayoutBox::computePercentageLogicalHeight() that was extracted to a separated static method LayoutBlock::availableLogicalHeightForPercentageComputation(). That way we can call hasDefiniteLogicalHeight() directly on an element to determine if the height is or not definite. This fixes a TODO related to orthogonal flows and also the example explained above. The orthogonal flows test results are updated and a new test is included. BUG=624301, 617876 TEST=fast/css-grid-layout/grid-container-percentage-rows.html Committed: https://crrev.com/9a12b00b915eccd82d4444ecba101f27e2761769 Cr-Commit-Position: refs/heads/master@{#415478}

Patch Set 1 #

Patch Set 2 : Fix fast/table/003.html test #

Total comments: 13

Patch Set 3 : New version #

Total comments: 8

Patch Set 4 : Minor changes from review and new test #

Patch Set 5 : Use 2 lines for bool includeBorderPadding #

Total comments: 14

Patch Set 6 : New version applying suggested changes #

Patch Set 7 : Same patch than previous version but rebased to current master #

Patch Set 8 : Add reference to bug #635655 on TODO comments #

Total comments: 3

Patch Set 9 : Check skipContainingBlockForPercentHeightCalculation() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+436 lines, -85 lines) Patch
A third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html View 1 chunk +296 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-grid-container-percentage-rows.html View 1 2 1 chunk +9 lines, -14 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-grid-container-percentage-rows-expected.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows.html View 4 chunks +8 lines, -8 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css-grid-layout/positioned-grid-container-item-percentage-size.html View 1 2 3 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/css-grid-layout/positioned-grid-container-item-percentage-size-expected.html View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlock.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlock.cpp View 1 2 3 4 5 6 7 8 1 chunk +55 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 4 chunks +1 line, -10 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 5 chunks +11 lines, -46 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGrid.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 28 (6 generated)
Manuel Rego
This is just fixing the initial issue reported on bug #624301. On a follow-up patch ...
4 years, 5 months ago (2016-07-15 11:36:09 UTC) #2
eae
OK, LGTM
4 years, 5 months ago (2016-07-15 17:41:04 UTC) #3
cbiesinger
Should hasAutoHeightOrContainingBlockWithAutoHeight use this new function now?
4 years, 5 months ago (2016-07-15 19:34:58 UTC) #4
Manuel Rego
On 2016/07/15 19:34:58, cbiesinger wrote: > Should hasAutoHeightOrContainingBlockWithAutoHeight use this new function now? That would ...
4 years, 5 months ago (2016-07-18 06:04:04 UTC) #5
jfernandez
https://codereview.chromium.org/2154593003/diff/20001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/2154593003/diff/20001/third_party/WebKit/Source/core/layout/LayoutBox.cpp#newcode2699 third_party/WebKit/Source/core/layout/LayoutBox.cpp:2699: LayoutUnit LayoutBox::availableLogicalHeightForPercentageComputation(const LayoutBlock* cb, bool skippedAutoHeightContainingBlock, bool scrollsOverflowY) I ...
4 years, 5 months ago (2016-07-18 06:13:24 UTC) #6
svillar
https://codereview.chromium.org/2154593003/diff/20001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp File third_party/WebKit/Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/2154593003/diff/20001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp#newcode1877 third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1877: return LayoutBox::availableLogicalHeightForPercentageComputation(this, false, scrollsOverflowY()) != LayoutUnit(-1); This is one ...
4 years, 5 months ago (2016-07-18 08:43:30 UTC) #7
cbiesinger
On 2016/07/18 06:04:04, Manuel Rego wrote: > On 2016/07/15 19:34:58, cbiesinger wrote: > > Should ...
4 years, 5 months ago (2016-07-18 20:53:14 UTC) #8
Manuel Rego
Thanks for the reviews. I've redo the patch and I think the result is much ...
4 years, 5 months ago (2016-07-19 13:12:32 UTC) #9
svillar
https://codereview.chromium.org/2154593003/diff/40001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp File third_party/WebKit/Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/2154593003/diff/40001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp#newcode1877 third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1877: LayoutUnit availableHeight = LayoutUnit(-1); LayoutUnit availableHeight(-1); https://codereview.chromium.org/2154593003/diff/40001/third_party/WebKit/Source/core/layout/LayoutBox.cpp File third_party/WebKit/Source/core/layout/LayoutBox.cpp ...
4 years, 5 months ago (2016-07-20 08:24:01 UTC) #10
Manuel Rego
Thanks for the review, some comments inline. https://codereview.chromium.org/2154593003/diff/40001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp File third_party/WebKit/Source/core/layout/LayoutBlock.cpp (right): https://codereview.chromium.org/2154593003/diff/40001/third_party/WebKit/Source/core/layout/LayoutBlock.cpp#newcode1877 third_party/WebKit/Source/core/layout/LayoutBlock.cpp:1877: LayoutUnit availableHeight ...
4 years, 5 months ago (2016-07-21 09:46:02 UTC) #11
cbiesinger
https://codereview.chromium.org/2154593003/diff/80001/third_party/WebKit/Source/core/layout/LayoutBlock.h File third_party/WebKit/Source/core/layout/LayoutBlock.h (right): https://codereview.chromium.org/2154593003/diff/80001/third_party/WebKit/Source/core/layout/LayoutBlock.h#newcode229 third_party/WebKit/Source/core/layout/LayoutBlock.h:229: static LayoutUnit availableLogicalHeightForPercentageComputation(const LayoutBlock&); Why make this a static ...
4 years, 5 months ago (2016-07-21 20:57:28 UTC) #12
jfernandez
https://codereview.chromium.org/2154593003/diff/80001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html File third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html (right): https://codereview.chromium.org/2154593003/diff/80001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html#newcode42 third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html:42: <p>This test checks that percentage rows behave as "auto" ...
4 years, 5 months ago (2016-07-22 11:26:37 UTC) #13
Manuel Rego
Thanks for the reviews, more work is needed as you've found some strange issues. https://codereview.chromium.org/2154593003/diff/80001/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-container-percentage-rows.html ...
4 years, 5 months ago (2016-07-22 13:05:37 UTC) #14
Manuel Rego
I believe the last version addresses the issues detected in the reviews. Please could you ...
4 years, 3 months ago (2016-08-25 09:29:38 UTC) #16
eae
Thank you, LGTM
4 years, 3 months ago (2016-08-25 18:40:45 UTC) #17
cbiesinger
https://codereview.chromium.org/2154593003/diff/140001/third_party/WebKit/Source/core/layout/LayoutBlock.h File third_party/WebKit/Source/core/layout/LayoutBlock.h (right): https://codereview.chromium.org/2154593003/diff/140001/third_party/WebKit/Source/core/layout/LayoutBlock.h#newcode229 third_party/WebKit/Source/core/layout/LayoutBlock.h:229: LayoutUnit availableLogicalHeightForPercentageComputation() const; Upon re-reading this patch, I really ...
4 years, 3 months ago (2016-08-25 21:50:23 UTC) #18
Manuel Rego
Uploaded new version. https://codereview.chromium.org/2154593003/diff/140001/third_party/WebKit/Source/core/layout/LayoutBlock.h File third_party/WebKit/Source/core/layout/LayoutBlock.h (right): https://codereview.chromium.org/2154593003/diff/140001/third_party/WebKit/Source/core/layout/LayoutBlock.h#newcode229 third_party/WebKit/Source/core/layout/LayoutBlock.h:229: LayoutUnit availableLogicalHeightForPercentageComputation() const; On 2016/08/25 21:50:23, ...
4 years, 3 months ago (2016-08-29 11:08:54 UTC) #19
cbiesinger
lgtm. I think I didn't fully understand this code previously. This seems good now. Thanks!
4 years, 3 months ago (2016-08-29 21:23:09 UTC) #20
jfernandez
lgtm
4 years, 3 months ago (2016-08-30 10:32:50 UTC) #21
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/2154593003/160001
4 years, 3 months ago (2016-08-30 21:10:53 UTC) #24
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 3 months ago (2016-08-30 23:00:54 UTC) #26
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 23:02:19 UTC) #28
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/9a12b00b915eccd82d4444ecba101f27e2761769
Cr-Commit-Position: refs/heads/master@{#415478}

Powered by Google App Engine
This is Rietveld 408576698