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

Issue 1421423005: [css-flexbox] Fix min-size: auto for a non-auto flex basis (Closed)

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

Description

[css-flexbox] Fix min-size: auto for a non-auto flex basis [IF THIS BREAKS ANY CONTENT/CHROME UI: Please do not revert this change. Instead, add "min-width: 0; min-height: 0; to your flex items, which should fix any issues that may occur] In https://codereview.chromium.org/1098593002 I fixed a perf regression in an incorrect way, leading to a correctness in certain circumstances. This patch fixes the correctness issue while still fixing the performance issue, by re-using the cached intrinsic width in most cases. Specifically, the optimization was assuming that we only need to apply min-width: auto if we applied flex-shrink. However, that is not correct. We also need to apply it if we have a flex-basis that's less than the min-content width, for example (most common case) flex-basis: 0. There might be further cases that could lead us to calculate a width less than min-width that I can't think of right now, so this is the safest way to fix this. Local performance data: WITH THIS PATCH: RESULT flexbox-with-stretch-layout: flexbox-with-stretch-layout.html= [15.430194,14.878406,15.044268,15.965514,14.611712] runs/s Avg flexbox-with-stretch-layout: 15.186019runs/s Sd flexbox-with-stretch-layout: 0.527205runs/s BEFORE THIS PATCH: RESULT flexbox-with-stretch-layout: flexbox-with-stretch-layout.html= [12.513922,12.225014,9.769322,10.982909,10.422027] runs/s Avg flexbox-with-stretch-layout: 11.182639runs/s Sd flexbox-with-stretch-layout: 1.169909runs/s BEFORE THE ORIGINAL PERF FIX: RESULT flexbox-with-stretch-layout: flexbox-with-stretch-layout.html= [9.750093,9.870511,9.825113,10.636098,9.464543] runs/s Avg flexbox-with-stretch-layout: 9.909272runs/s Sd flexbox-with-stretch-layout: 0.435885runs/s Adding all potentially related bugs to the BUG list here. I have not verified that all of them are indeed this specific issue. R=leviw@chromium.org BUG=546034, 477183, 504931, 504391, 491076 Committed: https://crrev.com/8b2c57bf0ac6c22f5a4d593d326f5f239b7d5808 Cr-Commit-Position: refs/heads/master@{#356667}

Patch Set 1 #

Total comments: 4

Patch Set 2 : review comments #

Patch Set 3 : fix tests #

Total comments: 1

Patch Set 4 : had to update some plugin placeholder files as well #

Total comments: 6

Patch Set 5 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -9 lines) Patch
M chrome/renderer/resources/plugins/plugin_poster.html View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/css3/flexbox/min-size-auto.html View 3 chunks +13 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/css3/flexbox/min-size-auto-expected.txt View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp View 1 2 6 chunks +14 lines, -7 lines 0 comments Download

Messages

Total messages: 40 (16 generated)
cbiesinger
5 years, 1 month ago (2015-10-28 01:07:05 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/1
5 years, 1 month ago (2015-10-28 01:08:40 UTC) #3
leviw_travelin_and_unemployed
https://codereview.chromium.org/1421423005/diff/1/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp File third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp (right): https://codereview.chromium.org/1421423005/diff/1/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp#newcode452 third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp:452: if (size.type() == MinContent && styleRef().logicalWidth().isAuto()) if (styleRef().logicalWidth().isAuto) { ...
5 years, 1 month ago (2015-10-28 01:24:57 UTC) #4
cbiesinger
https://codereview.chromium.org/1421423005/diff/1/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp File third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp (right): https://codereview.chromium.org/1421423005/diff/1/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp#newcode452 third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp:452: if (size.type() == MinContent && styleRef().logicalWidth().isAuto()) On 2015/10/28 01:24:56, ...
5 years, 1 month ago (2015-10-28 01:55:24 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/20001
5 years, 1 month ago (2015-10-28 01:56:26 UTC) #8
leviw_travelin_and_unemployed
lgtm
5 years, 1 month ago (2015-10-28 02:05:05 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/70951)
5 years, 1 month ago (2015-10-28 02:39:39 UTC) #11
cbiesinger
On 2015/10/28 02:39:39, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
5 years, 1 month ago (2015-10-28 03:31:16 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/40001
5 years, 1 month ago (2015-10-28 18:25:56 UTC) #14
cbiesinger
(also min-size-auto.html needed new expectations because there are more PASS lines now) https://codereview.chromium.org/1421423005/diff/40001/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp File third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp ...
5 years, 1 month ago (2015-10-28 18:27:59 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/40001
5 years, 1 month ago (2015-10-28 18:33:19 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/132593)
5 years, 1 month ago (2015-10-28 19:08:54 UTC) #21
cbiesinger
Bernhard, Tommy - could one of you give me an lgtm for the chrome/renderer/resources/plugins files? ...
5 years, 1 month ago (2015-10-28 20:01:48 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/60001
5 years, 1 month ago (2015-10-28 20:02:08 UTC) #25
tommycli
lgtm sans below: I think most of the min-height/width declarations aren't needed to pass the ...
5 years, 1 month ago (2015-10-28 21:02:01 UTC) #28
cbiesinger
https://codereview.chromium.org/1421423005/diff/60001/chrome/renderer/resources/plugins/plugin_placeholders.css File chrome/renderer/resources/plugins/plugin_placeholders.css (right): https://codereview.chromium.org/1421423005/diff/60001/chrome/renderer/resources/plugins/plugin_placeholders.css#newcode44 chrome/renderer/resources/plugins/plugin_placeholders.css:44: #inner { On 2015/10/28 21:02:01, tommycli wrote: > probably ...
5 years, 1 month ago (2015-10-28 21:13:14 UTC) #29
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/132692)
5 years, 1 month ago (2015-10-28 21:14:36 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421423005/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421423005/80001
5 years, 1 month ago (2015-10-28 21:14:53 UTC) #33
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 1 month ago (2015-10-28 22:17:36 UTC) #34
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/8b2c57bf0ac6c22f5a4d593d326f5f239b7d5808 Cr-Commit-Position: refs/heads/master@{#356667}
5 years, 1 month ago (2015-10-28 22:18:38 UTC) #35
Dan Beam
> [IF THIS BREAKS ANY CONTENT/CHROME UI: Please do not revert this change. I don't ...
5 years, 1 month ago (2015-11-03 05:18:58 UTC) #37
esprehn
On 2015/11/03 at 05:18:58, dbeam wrote: > > [IF THIS BREAKS ANY CONTENT/CHROME UI: Please ...
5 years, 1 month ago (2015-11-03 05:31:16 UTC) #38
Dan Beam
On 2015/11/03 05:31:16, esprehn wrote: > On 2015/11/03 at 05:18:58, dbeam wrote: > > > ...
5 years, 1 month ago (2015-11-03 05:43:18 UTC) #39
cbiesinger
5 years, 1 month ago (2015-11-03 14:33:21 UTC) #40
Message was sent while issue was closed.
On 2015/11/03 05:43:18, Dan Beam wrote:
> On 2015/11/03 05:31:16, esprehn wrote:
> > On 2015/11/03 at 05:18:58, dbeam wrote:
> > > > [IF THIS BREAKS ANY CONTENT/CHROME UI: Please do not revert this change.
> > > 
> > > I don't really see how Chrome's UI is any different from the open web's in
> > this regard (other than we get to play with the new toys sooner and have
> revert
> > access).
> > > 
> > > This will probably break lots of sites.  Hopefully they'll have the
ability
> to
> > update their code in a timely manner (i.e. it's not stuck in some library or
> > cached forever).
> > > 
> > > I'll keep updating parts of Chrome that this broke (mainly the new
downloads
> > UI).
> > 
> > This broke the new codereview site as well, but it was already broken in
> > Firefox. So this is forcing authors to make their code work in Firefox which
> is
> > nice.
> 
> if firefox already had this behavior I suppose it's good to be consistent.

Yes, both Edge and Firefox have this behavior. I should probably have included
that in the commit message.

The other thing is that before *this* checkin, we had this weird
half-implemented min-width: auto behavior which just doesn't make sense. So, I
think it's best for the web to see this through and work through the breakage.

Powered by Google App Engine
This is Rietveld 408576698