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

Issue 331203002: Blink doesn't honor percent heights on children of "align-self:stretch" flex items in a fixed-height (Closed)

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

Description

Blink doesn't honor percent heights on children of "align-self:stretch" flex items in a fixed-height flex container Blink does not honor percent heights on children of flex items having align-self:stretch in a fixed-height flex container. It ignores the height specified in percent and take the height as min-content height. This bug occurs because while applying stretch alignment to the flex-item we set the OverrideLogicalContentHeight for the flex-item but while computing PercentageLogicalHeight for the children of the flex-item in the api RenderBox::computePercentageLogicalHeight we are checking for hasOverrideContainingBlockLogicalHeight() which checks if the child which is having percentage height has overrideLogicalHeight or not. Since for the child we had not set overideLogicalHeight so this condtion returns false and available height for child becomes -1. Hence it takes height as min-content height. This patch fixes this bug by using overrideLogicalContentHeight() of containing block as availableHeight while computing the percentage heights of children of flex item having stretch alignment. Also for the cases where desiredLogicalHeight == logicalHeight() and flex item hasPercentHeightDescendants() we are forcing a relayout of the flex item as overrideLogicalContentHeight() gets cleared off while calculating preferredMainAxisContentExtentForChild BUG=341310, 346275 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182735

Patch Set 1 #

Patch Set 2 : New patch set based on comments in patch set 1 #

Total comments: 2

Patch Set 3 : New patch set based on comments in patch set 2 #

Patch Set 4 : New patch set #

Total comments: 4

Patch Set 5 : Addresses changes asked in comments in patch 4 #

Total comments: 6

Patch Set 6 : Addresses changes asked in comments in patch set 5 #

Total comments: 2

Patch Set 7 : Modifying solution to support the test case mention in patch set 6 #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Total comments: 9

Patch Set 14 : #

Total comments: 2

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Total comments: 2

Patch Set 20 : #

Patch Set 21 : #

Patch Set 22 : #

Patch Set 23 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -34 lines) Patch
M LayoutTests/css3/flexbox/flex-align.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html View 1 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/css3/flexbox/flex-flow-padding.html View 1 2 3 4 5 6 7 8 chunks +16 lines, -16 lines 0 comments Download
A LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +94 lines, -0 lines 0 comments Download
A + LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item-expected.txt View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +16 lines, -11 lines 0 comments Download
M Source/core/rendering/RenderFlexibleBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderFlexibleBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +12 lines, -3 lines 0 comments Download

Messages

Total messages: 79 (3 generated)
harpreet.sk
Please have a look. I will add the layout test for the same in next ...
6 years, 6 months ago (2014-06-16 15:21:02 UTC) #1
tony
Where in the spec does it say we should skip the flexbox height when resolving ...
6 years, 6 months ago (2014-06-16 16:45:54 UTC) #2
cbiesinger
I am fairly sure this change is incorrect, because the real bug is described in ...
6 years, 6 months ago (2014-06-17 01:50:07 UTC) #3
cbiesinger
not lgtm
6 years, 6 months ago (2014-06-17 01:50:32 UTC) #4
harpreet.sk
On 2014/06/17 01:50:07, cbiesinger wrote: > I am fairly sure this change is incorrect, because ...
6 years, 6 months ago (2014-06-18 14:04:59 UTC) #5
tony
This didn't look right, so I ran it through the try bots. Looks like this ...
6 years, 6 months ago (2014-06-18 17:53:18 UTC) #6
arpitabahuguna
The CQ bit was checked by a.bah@chromium.org
6 years, 6 months ago (2014-06-19 08:49:56 UTC) #7
arpitabahuguna
The CQ bit was unchecked by a.bah@chromium.org
6 years, 6 months ago (2014-06-19 08:50:48 UTC) #8
harpreet.sk
https://codereview.chromium.org/331203002/diff/20001/Source/core/rendering/RenderBox.cpp File Source/core/rendering/RenderBox.cpp (right): https://codereview.chromium.org/331203002/diff/20001/Source/core/rendering/RenderBox.cpp#newcode2678 Source/core/rendering/RenderBox.cpp:2678: availableHeight = cb->overrideContainingBlockContentLogicalHeight(); On 2014/06/18 17:53:18, tony wrote: > ...
6 years, 6 months ago (2014-06-19 12:22:39 UTC) #9
harpreet.sk
On 2014/06/18 17:53:18, tony wrote: > This didn't look right, so I ran it through ...
6 years, 6 months ago (2014-06-19 12:24:11 UTC) #10
tony
https://codereview.chromium.org/331203002/diff/60001/LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html File LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html (right): https://codereview.chromium.org/331203002/diff/60001/LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html#newcode27 LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html:27: <div data-expected-height="70" style="height: 70%; background-color:lime">Horizontal Writing Mode</div> Please add ...
6 years, 6 months ago (2014-06-19 16:37:47 UTC) #11
harpreet.sk
Please have a look. https://codereview.chromium.org/331203002/diff/60001/LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html File LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html (right): https://codereview.chromium.org/331203002/diff/60001/LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html#newcode27 LayoutTests/css3/flexbox/percent-height-children-of-alignSelf-stretch-flex-item.html:27: <div data-expected-height="70" style="height: 70%; background-color:lime">Horizontal ...
6 years, 6 months ago (2014-06-20 14:54:32 UTC) #12
tony
This LGTM, but I am not an OWNER. I started a job on the trybots.
6 years, 6 months ago (2014-06-23 16:57:53 UTC) #13
leviw_travelin_and_unemployed
Owner lgtm.
6 years, 6 months ago (2014-06-23 17:09:23 UTC) #14
harpreet.sk
The CQ bit was checked by harpreet.sk@samsung.com
6 years, 6 months ago (2014-06-23 18:16:20 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/331203002/80001
6 years, 6 months ago (2014-06-23 18:17:02 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-23 18:17:05 UTC) #17
commit-bot: I haz the power
A disapproval has been posted by following reviewers: cbiesinger@chromium.org. Please make sure to get positive ...
6 years, 6 months ago (2014-06-23 18:17:05 UTC) #18
harpreet.sk
@Christian can you please give lgtm
6 years, 6 months ago (2014-06-23 18:19:03 UTC) #19
cbiesinger
Please fix the issues below, and also add a testcase for the example tony mentioned. ...
6 years, 6 months ago (2014-06-24 03:01:28 UTC) #20
cbiesinger
Oh, please also add a testcase that has a max-height on the flexitem and then ...
6 years, 6 months ago (2014-06-24 03:04:09 UTC) #21
harpreet.sk
Thanks christian for the review. I had added the test cases which you have asked ...
6 years, 6 months ago (2014-06-24 07:57:00 UTC) #22
cbiesinger
Thanks for updating the patch. I would like to try some more testcases with it, ...
6 years, 6 months ago (2014-06-24 22:59:25 UTC) #23
cbiesinger
https://codereview.chromium.org/331203002/diff/100001/Source/core/rendering/RenderFlexibleBox.cpp File Source/core/rendering/RenderFlexibleBox.cpp (right): https://codereview.chromium.org/331203002/diff/100001/Source/core/rendering/RenderFlexibleBox.cpp#newcode1376 Source/core/rendering/RenderFlexibleBox.cpp:1376: if (desiredLogicalHeight != child->logicalHeight()) { So I just realized ...
6 years, 6 months ago (2014-06-25 04:14:32 UTC) #24
cbiesinger
On 2014/06/24 07:57:00, harpreet.sk wrote: > else if (cb->isFlexItemIncludingDeprecated()) > availableHeight = cb->overrideLogicalContentHeight(); > > ...
6 years, 6 months ago (2014-06-25 04:39:08 UTC) #25
harpreet.sk
Uploaded with some new changes to support the test case as mention in previous comments. ...
6 years, 6 months ago (2014-06-25 14:43:08 UTC) #26
harpreet.sk
PING
6 years, 6 months ago (2014-06-26 18:12:23 UTC) #27
cbiesinger
Sorry, I won't have time for a full review for the rest of the week. ...
6 years, 6 months ago (2014-06-26 19:54:19 UTC) #28
harpreet.sk
On 2014/06/26 19:54:19, cbiesinger wrote: > Sorry, I won't have time for a full review ...
6 years, 4 months ago (2014-07-30 09:16:26 UTC) #29
harpreet.sk
ping...
6 years, 4 months ago (2014-08-05 19:09:33 UTC) #30
cbiesinger
> But for cases where desiredLogicalHeight == child->logicalHeight() override > height values will get reset ...
6 years, 4 months ago (2014-08-06 03:04:42 UTC) #31
cbiesinger
Thanks for pointing out the bugs, commented/resolved them. Also thanks for doing all the flexbox ...
6 years, 4 months ago (2014-08-06 03:11:01 UTC) #32
harpreet.sk
On 2014/08/06 03:04:42, cbiesinger wrote: > > But for cases where desiredLogicalHeight == child->logicalHeight() override ...
6 years, 4 months ago (2014-08-06 12:34:32 UTC) #33
cbiesinger
On 2014/08/06 12:34:32, harpreet.sk wrote: > On 2014/08/06 03:04:42, cbiesinger wrote: > > > But ...
6 years, 4 months ago (2014-08-07 03:19:00 UTC) #34
harpreet.sk
On 2014/08/07 03:19:00, cbiesinger wrote: > On 2014/08/06 12:34:32, harpreet.sk wrote: > > @Chris: Sorry, ...
6 years, 4 months ago (2014-08-07 12:26:08 UTC) #35
cbiesinger
On 2014/08/07 12:26:08, harpreet.sk wrote: > On 2014/08/07 03:19:00, cbiesinger wrote: > > On 2014/08/06 ...
6 years, 4 months ago (2014-08-08 03:21:02 UTC) #36
harpreet.sk
On 2014/08/08 03:21:02, cbiesinger wrote: > Hm... I kinda get what you're saying, but this ...
6 years, 4 months ago (2014-08-11 12:13:14 UTC) #37
cbiesinger
lgtm. Perfect! Thanks for bearing with me.
6 years, 4 months ago (2014-08-11 22:54:23 UTC) #38
harpreet.sk
On 2014/08/11 22:54:23, cbiesinger wrote: > lgtm. Perfect! Thanks for bearing with me. Thanks Chris ...
6 years, 4 months ago (2014-08-18 08:55:32 UTC) #39
cbiesinger
not lgtm sorry, I just talked to a coworker and realized that this is forcing ...
6 years, 4 months ago (2014-08-19 02:44:55 UTC) #40
cbiesinger
To avoid that unnecessary layout, I think the following approach will work: We keep a ...
6 years, 4 months ago (2014-08-21 23:59:22 UTC) #41
harpreet.sk
On 2014/08/21 23:59:22, cbiesinger wrote: > To avoid that unnecessary layout, I think the following ...
6 years, 4 months ago (2014-08-25 11:47:54 UTC) #42
cbiesinger
On 2014/08/25 11:47:54, harpreet.sk wrote: > On 2014/08/21 23:59:22, cbiesinger wrote: > > To avoid ...
6 years, 3 months ago (2014-08-27 00:53:40 UTC) #43
harpreet.sk
On 2014/08/27 00:53:40, cbiesinger wrote: > Thanks for the updated patch. I am not familiar ...
6 years, 3 months ago (2014-08-27 10:20:32 UTC) #44
cbiesinger
This is a great idea and I think it will work. Just two minor comments ...
6 years, 3 months ago (2014-08-28 03:05:56 UTC) #45
ojan
This is a good idea. I'm a little scared of not clearing the override size ...
6 years, 3 months ago (2014-08-28 03:23:09 UTC) #46
harpreet.sk
Made changes. PTAL... https://codereview.chromium.org/331203002/diff/240001/Source/core/rendering/RenderBox.cpp File Source/core/rendering/RenderBox.cpp (right): https://codereview.chromium.org/331203002/diff/240001/Source/core/rendering/RenderBox.cpp#newcode2284 Source/core/rendering/RenderBox.cpp:2284: if (flexitem->style()->marginBefore().isAuto() || flexitem->style()->marginAfter().isAuto()) On 2014/08/28 ...
6 years, 3 months ago (2014-08-28 14:30:20 UTC) #47
cbiesinger
https://codereview.chromium.org/331203002/diff/240001/Source/core/rendering/RenderFlexibleBox.cpp File Source/core/rendering/RenderFlexibleBox.cpp (right): https://codereview.chromium.org/331203002/diff/240001/Source/core/rendering/RenderFlexibleBox.cpp#newcode1364 Source/core/rendering/RenderFlexibleBox.cpp:1364: child->setOverrideLogicalContentHeight(desiredLogicalHeight - child->borderAndPaddingLogicalHeight()); On 2014/08/28 14:30:20, harpreet.sk wrote: > ...
6 years, 3 months ago (2014-08-29 00:28:10 UTC) #48
harpreet.sk
https://codereview.chromium.org/331203002/diff/260001/Source/core/rendering/RenderFlexibleBox.cpp File Source/core/rendering/RenderFlexibleBox.cpp (right): https://codereview.chromium.org/331203002/diff/260001/Source/core/rendering/RenderFlexibleBox.cpp#newcode217 Source/core/rendering/RenderFlexibleBox.cpp:217: child->clearOverrideSize(); On 2014/08/29 00:28:09, cbiesinger wrote: > Hmm, so ...
6 years, 3 months ago (2014-09-01 08:10:59 UTC) #49
harpreet.sk
On 2014/08/29 00:28:10, cbiesinger wrote: > Apologies, you are correct. I tried to make a ...
6 years, 3 months ago (2014-09-01 08:15:44 UTC) #50
harpreet.sk
ping..
6 years, 3 months ago (2014-09-04 13:51:17 UTC) #51
cbiesinger
Sorry, I don't see how the 6th testcase tests that. Maybe I counted wrong - ...
6 years, 3 months ago (2014-09-05 00:34:15 UTC) #52
harpreet.sk
On 2014/09/05 00:34:15, cbiesinger wrote: > Sorry, I don't see how the 6th testcase tests ...
6 years, 3 months ago (2014-09-05 12:20:34 UTC) #53
cbiesinger
On 2014/09/05 12:20:34, harpreet.sk wrote: > On 2014/09/05 00:34:15, cbiesinger wrote: > > Sorry, I ...
6 years, 3 months ago (2014-09-06 01:01:46 UTC) #54
harpreet.sk
On 2014/09/06 01:01:46, cbiesinger wrote: > Ah, neat. I missed that. Thanks! > > But ...
6 years, 3 months ago (2014-09-08 09:48:56 UTC) #55
cbiesinger
On 2014/09/08 09:48:56, harpreet.sk wrote: > On 2014/09/06 01:01:46, cbiesinger wrote: > > Ah, neat. ...
6 years, 3 months ago (2014-09-08 22:25:36 UTC) #56
harpreet.sk
On 2014/09/08 22:25:36, cbiesinger wrote: > Hmm, I see that you're right in that the ...
6 years, 3 months ago (2014-09-09 09:25:27 UTC) #57
cbiesinger
On 2014/09/09 09:25:27, harpreet.sk wrote: > On 2014/09/08 22:25:36, cbiesinger wrote: > > > Hmm, ...
6 years, 3 months ago (2014-09-09 22:31:21 UTC) #58
harpreet.sk
On 2014/09/09 22:31:21, cbiesinger wrote: > But, which of the "return false" in layoutBlockFlow gets ...
6 years, 3 months ago (2014-09-10 11:57:13 UTC) #59
cbiesinger
On 2014/09/10 11:57:13, harpreet.sk wrote: > On 2014/09/09 22:31:21, cbiesinger wrote: > > > But, ...
6 years, 3 months ago (2014-09-11 06:27:07 UTC) #60
harpreet.sk
On 2014/09/11 06:27:07, cbiesinger wrote: > I'll have to think about your comment later, but ...
6 years, 3 months ago (2014-09-11 06:34:51 UTC) #61
harpreet.sk
ping ..
6 years, 3 months ago (2014-09-16 11:17:37 UTC) #62
cbiesinger
I am so sorry for my late response. What if you simply copy/paste my jsbin ...
6 years, 3 months ago (2014-09-17 02:02:47 UTC) #63
harpreet.sk
On 2014/09/17 02:02:47, cbiesinger wrote: > I am so sorry for my late response. What ...
6 years, 3 months ago (2014-09-18 14:18:24 UTC) #64
cbiesinger
On 2014/09/18 14:18:24, harpreet.sk wrote: > On 2014/09/17 02:02:47, cbiesinger wrote: > > I am ...
6 years, 3 months ago (2014-09-19 02:47:36 UTC) #65
harpreet.sk
On 2014/09/19 02:47:36, cbiesinger wrote: > I think we only need that *if* overrideLogicalHeight != ...
6 years, 3 months ago (2014-09-22 17:54:54 UTC) #66
cbiesinger
On 2014/09/22 17:54:54, harpreet.sk wrote: > On 2014/09/19 02:47:36, cbiesinger wrote: > > > I ...
6 years, 3 months ago (2014-09-22 23:39:11 UTC) #67
harpreet.sk
On 2014/09/22 23:39:11, cbiesinger wrote: > I'm not sure I follow. If hasOverrideHeight() returns false, ...
6 years, 3 months ago (2014-09-23 13:09:24 UTC) #68
cbiesinger
lgtm! Just a couple minor changes. Thanks for bearing with me for this really long ...
6 years, 2 months ago (2014-09-25 00:50:31 UTC) #69
harpreet.sk
Made changes. Please have a look. Also i need to ask regarding Bug=346275. Our patch ...
6 years, 2 months ago (2014-09-25 12:58:57 UTC) #70
cbiesinger
lgtm I added that bug to this patch and will put it in the commit ...
6 years, 2 months ago (2014-09-25 22:12:41 UTC) #71
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/331203002/380001
6 years, 2 months ago (2014-09-25 22:14:10 UTC) #73
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/android_chromium_gn_compile_rel/builds/11750)
6 years, 2 months ago (2014-09-25 22:24:23 UTC) #75
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/331203002/380001
6 years, 2 months ago (2014-09-26 05:31:01 UTC) #77
commit-bot: I haz the power
Committed patchset #20 (id:380001) as 182735
6 years, 2 months ago (2014-09-26 06:26:06 UTC) #78
alph
6 years, 2 months ago (2014-09-29 16:11:00 UTC) #79
Message was sent while issue was closed.
A revert of this CL (patchset #20 id:380001) has been created in
https://codereview.chromium.org/616583002/ by alph@chromium.org.

The reason for reverting is: The patch broke a canvas with forced height in
DevTools. See crbug.com/418591.

Powered by Google App Engine
This is Rietveld 408576698