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

Issue 237823002: Properly shrink stretched flexbox children on relayout (Closed)

Created:
6 years, 8 months ago by leviw_travelin_and_unemployed
Modified:
6 years, 8 months ago
Reviewers:
tony, ojan
CC:
blink-reviews, bemjb+rendering_chromium.org, dsinclair, zoltan1, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, pdr., rune+blink
Visibility:
Public.

Description

Properly shrink stretched flexbox children on relayout In Blink r164728, I landed an optimization to flexbox layout to avoid forcing layout on children that may be stretched in layoutAndPlaceChildren, since applyStretchAlignmentToChild already does this. This is correct on the first layout, but if a flexbox shrinks, we would continue using the override stretched size for subsequent relayouts, which would prevent stretched children (and the flexbox) from collapsing down to the correct size. This patch uses the intrinsic content logical height in layoutAndPlaceChildren to accumulate the flexbox height and to diff against the actual height of the children in applyStretchAlignmentToChild. To do this, I added several convenience methods to RenderFlexibleBox, and fixed an issue with the cached intrinsic content logical height of text controls (it failed to include the inner text box... the fix is hacky). BUG=358743 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171893

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address nits #

Patch Set 3 : Fix remaining computeLogicalHeight methods #

Total comments: 1

Patch Set 4 : Made comments clearer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -6 lines) Patch
A LayoutTests/css3/flexbox/stretched-child-shrink-on-relayout.html View 1 1 chunk +72 lines, -0 lines 0 comments Download
A + LayoutTests/css3/flexbox/stretched-child-shrink-on-relayout-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/html/shadow/SliderThumbElement.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBox.h View 1 2 3 chunks +4 lines, -1 line 0 comments Download
M Source/core/rendering/RenderFlexibleBox.h View 3 chunks +5 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderFlexibleBox.cpp View 1 2 5 chunks +46 lines, -4 lines 0 comments Download
M Source/core/rendering/RenderListBox.cpp View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M Source/core/rendering/RenderReplaced.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTextControl.cpp View 1 1 chunk +7 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
leviw_travelin_and_unemployed
I don't love what needed to be done in the name of this optimization... let ...
6 years, 8 months ago (2014-04-14 21:49:59 UTC) #1
ojan
lgtm The RenderTextControl bit is gross, but I think it's just a symptom of RenderTextControl ...
6 years, 8 months ago (2014-04-15 01:07:30 UTC) #2
leviw_travelin_and_unemployed
Agreed re: the RenderTextControl change. That's the part that made me sad, but it's a ...
6 years, 8 months ago (2014-04-15 06:53:38 UTC) #3
leviw_travelin_and_unemployed
The CQ bit was checked by leviw@chromium.org
6 years, 8 months ago (2014-04-15 16:33:05 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/237823002/20001
6 years, 8 months ago (2014-04-15 16:33:28 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-15 17:08:46 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 8 months ago (2014-04-15 17:08:46 UTC) #7
leviw_travelin_and_unemployed
The CQ bit was checked by leviw@chromium.org
6 years, 8 months ago (2014-04-16 18:45:20 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/237823002/20001
6 years, 8 months ago (2014-04-16 18:45:31 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-16 19:17:48 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 8 months ago (2014-04-16 19:17:48 UTC) #11
leviw_travelin_and_unemployed
PTAL. I had to add some more intrinsic height changes for other renderer types.
6 years, 8 months ago (2014-04-16 22:29:26 UTC) #12
leviw_travelin_and_unemployed
ping
6 years, 8 months ago (2014-04-17 18:29:34 UTC) #13
ojan
lgtm https://codereview.chromium.org/237823002/diff/40001/Source/core/html/shadow/SliderThumbElement.cpp File Source/core/html/shadow/SliderThumbElement.cpp (right): https://codereview.chromium.org/237823002/diff/40001/Source/core/html/shadow/SliderThumbElement.cpp#newcode131 Source/core/html/shadow/SliderThumbElement.cpp:131: // FIXME: This height should have been added ...
6 years, 8 months ago (2014-04-17 20:01:32 UTC) #14
leviw_travelin_and_unemployed
On 2014/04/17 20:01:32, ojan wrote: > lgtm > > https://codereview.chromium.org/237823002/diff/40001/Source/core/html/shadow/SliderThumbElement.cpp > File Source/core/html/shadow/SliderThumbElement.cpp (right): > ...
6 years, 8 months ago (2014-04-17 20:58:59 UTC) #15
leviw_travelin_and_unemployed
The CQ bit was checked by leviw@chromium.org
6 years, 8 months ago (2014-04-17 20:59:05 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/237823002/60001
6 years, 8 months ago (2014-04-17 21:00:58 UTC) #17
commit-bot: I haz the power
6 years, 8 months ago (2014-04-17 22:19:22 UTC) #18
Message was sent while issue was closed.
Change committed as 171893

Powered by Google App Engine
This is Rietveld 408576698