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

Issue 1184563002: Fix broken preferred widths optimization involving subtree layout roots (Closed)

Created:
5 years, 6 months ago by leviw_travelin_and_unemployed
Modified:
5 years, 6 months ago
CC:
blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix broken preferred widths optimization involving subtree layout roots Back in an old, poorly explained commit, we added logic in LayoutBox::computePreferredLogicalWidths to bail when in a subtree layout. This may have been to cover up a bug whereby we'd get the value wrong in this case, or it may have been an optimization: https://chromium.googlesource.com/chromium/blink/+/0d46936cccddf2caa4d484e27fbccfe2520ca214%5E%21/#F8 This code can result in a box not updating its preferred widths even when it should in the case that its a subtree layout root that was marked for layout of its children, then subsequently marked for layout itself. We shouldn't be calling computePreferredLogicalWidths if we don't need to, instead of having this crazy short-circuit logic inside it. BUG=497178 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197060

Patch Set 1 #

Total comments: 3

Patch Set 2 : Remove the code! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -4 lines) Patch
A LayoutTests/fast/layout/nested-subtree-layout-preferred-widths.html View 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/layout/nested-subtree-layout-preferred-widths-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutBox.cpp View 1 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
leviw_travelin_and_unemployed
5 years, 6 months ago (2015-06-11 22:56:35 UTC) #2
leviw_travelin_and_unemployed
5 years, 6 months ago (2015-06-12 00:00:30 UTC) #4
chrishtr
https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp File Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp#newcode1950 Source/core/layout/LayoutBox.cpp:1950: if (node() && !parent()->needsLayout() && view()->frameView() && view()->frameView()->isLayoutRoot(*this)) Maybe ...
5 years, 6 months ago (2015-06-12 00:42:26 UTC) #5
esprehn
https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp File Source/core/layout/LayoutBox.cpp (right): https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp#newcode1950 Source/core/layout/LayoutBox.cpp:1950: if (node() && !parent()->needsLayout() && view()->frameView() && view()->frameView()->isLayoutRoot(*this)) On ...
5 years, 6 months ago (2015-06-12 00:44:52 UTC) #6
leviw_travelin_and_unemployed
On 2015/06/12 at 00:42:26, chrishtr wrote: > https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp > File Source/core/layout/LayoutBox.cpp (right): > > https://codereview.chromium.org/1184563002/diff/1/Source/core/layout/LayoutBox.cpp#newcode1950 ...
5 years, 6 months ago (2015-06-12 00:46:05 UTC) #7
leviw_travelin_and_unemployed
I'll defer to the crowd, but I think the optimization is likely worthwhile.
5 years, 6 months ago (2015-06-12 00:47:15 UTC) #8
ojan
Hmmm...I'm a bit confused about this optimization. Avoiding computing preferred width where we otherwise would ...
5 years, 6 months ago (2015-06-12 01:06:16 UTC) #10
ojan
I looked up the patch that added this. There's no real explanation for it. https://chromium.googlesource.com/chromium/blink/+/0d46936cccddf2caa4d484e27fbccfe2520ca214%5E%21/#F8
5 years, 6 months ago (2015-06-12 01:10:45 UTC) #11
ojan
But it did come with a test. Does floating-textfield-relayout pass if you get rid of ...
5 years, 6 months ago (2015-06-12 01:12:18 UTC) #12
leviw_travelin_and_unemployed
Code removed. Tests pass. PTAL.
5 years, 6 months ago (2015-06-12 18:54:44 UTC) #13
ojan
Lgtm, but please update the change description now that we know this isn't a preferred ...
5 years, 6 months ago (2015-06-12 19:41:07 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1184563002/20001
5 years, 6 months ago (2015-06-12 20:14:57 UTC) #16
commit-bot: I haz the power
5 years, 6 months ago (2015-06-12 20:18:50 UTC) #17
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197060

Powered by Google App Engine
This is Rietveld 408576698