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

Issue 478233004: Flexbox flex: 1 incorrectly sets flex-basis to 0px (Closed)

Created:
6 years, 4 months ago by harpreet.sk
Modified:
5 years, 7 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, ed+blinkwatch_opera.com, rwlbuis, rune+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Flexbox flex: 1 incorrectly sets flex-basis to 0px Flexbox incorrectly sets the flex-basis to 0px when specified flex: 1. According to the spec http://www.w3.org/TR/css3-flexbox/#propdef-flex whenever the flex basis is omitted from the flex shorthand its specified value is 0%. Also there are few issues which are seen for column flexbox here: 1. A flex-basis of 0px is incorrectly considered to behave like flex-basis of auto (taking intrinsic height). Correct behaviour is to set height to 0. 2. A flex-basis of 0% is incorrectly compute to 0 height when the containing block has no intrinsic size. Correct behaviour is to set height equal to min-content of flex-item. This patch fixes this bug by first setting flex-basis to 0% and not 0px when omitted in flex shorthand while parsing flex value. Also the reason why flex-basis of 0px is taking min-content as height and 0% flex-basis is computing height to 0 is because while computing the preferredMainAxisContentExtentForChild the condition which checks if preferredMainAxisExtentDependsOnLayout return true for 0px case (flex-basis fixed and value 0) and false for 0% case (flex-basis percent and 0 value). Ideally it should do vice versa returning true (ie main axis extent depends on layout) for percent case and false (not depends on layout) for pixel case. This patch fixes this check so that it behaves correctly. BUG=404337 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181012

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -34 lines) Patch
M LayoutTests/css3/calc/number-parsing.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/css3/flexbox/flex-longhand-parsing.html View 1 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/css3/flexbox/flex-longhand-parsing-expected.txt View 1 1 chunk +3 lines, -3 lines 0 comments Download
A LayoutTests/css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A LayoutTests/css3/flexbox/flex-one-sets-flex-basis-to-zero-px-expected.txt View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M LayoutTests/css3/flexbox/flex-property-parsing.html View 1 2 chunks +12 lines, -12 lines 0 comments Download
M LayoutTests/css3/flexbox/flex-property-parsing-expected.txt View 1 2 chunks +12 lines, -12 lines 0 comments Download
M LayoutTests/css3/flexbox/percentage-sizes-quirks.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFlexibleBox.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
harpreet.sk
ptal....
6 years, 4 months ago (2014-08-21 13:47:23 UTC) #1
cbiesinger
Thanks for working on this! https://codereview.chromium.org/478233004/diff/60001/Source/core/rendering/RenderFlexibleBox.cpp File Source/core/rendering/RenderFlexibleBox.cpp (left): https://codereview.chromium.org/478233004/diff/60001/Source/core/rendering/RenderFlexibleBox.cpp#oldcode605 Source/core/rendering/RenderFlexibleBox.cpp:605: return flexBasis.isAuto() || (flexBasis.isFixed() ...
6 years, 4 months ago (2014-08-21 23:54:23 UTC) #2
harpreet.sk
Made changes. PTAL. https://codereview.chromium.org/478233004/diff/60001/Source/core/rendering/RenderFlexibleBox.cpp File Source/core/rendering/RenderFlexibleBox.cpp (left): https://codereview.chromium.org/478233004/diff/60001/Source/core/rendering/RenderFlexibleBox.cpp#oldcode605 Source/core/rendering/RenderFlexibleBox.cpp:605: return flexBasis.isAuto() || (flexBasis.isFixed() && !flexBasis.value() ...
6 years, 4 months ago (2014-08-22 15:13:35 UTC) #3
cbiesinger
On 2014/08/22 15:13:35, harpreet.sk wrote: > Made changes. PTAL. > > https://codereview.chromium.org/478233004/diff/60001/Source/core/rendering/RenderFlexibleBox.cpp > File Source/core/rendering/RenderFlexibleBox.cpp ...
6 years, 3 months ago (2014-08-27 00:48:59 UTC) #4
harpreet.sk
On 2014/08/27 00:48:59, cbiesinger wrote: > > I'm sorry, I don't understand why hasInfiniteLineLength can't ...
6 years, 3 months ago (2014-08-27 03:35:42 UTC) #5
cbiesinger
On 2014/08/27 03:35:42, harpreet.sk wrote: > On 2014/08/27 00:48:59, cbiesinger wrote: > > > > ...
6 years, 3 months ago (2014-08-28 02:28:06 UTC) #6
cbiesinger
lgtm
6 years, 3 months ago (2014-08-28 02:28:15 UTC) #7
harpreet.sk
Owner's please give lgtm
6 years, 3 months ago (2014-08-28 03:33:05 UTC) #8
ojan
lgtm
6 years, 3 months ago (2014-08-28 03:36:18 UTC) #9
harpreet.sk
The CQ bit was checked by harpreet.sk@samsung.com
6 years, 3 months ago (2014-08-28 04:26:32 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/harpreet.sk@samsung.com/478233004/80001
6 years, 3 months ago (2014-08-28 04:26:58 UTC) #11
commit-bot: I haz the power
6 years, 3 months ago (2014-08-28 05:02:55 UTC) #12
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as 181012

Powered by Google App Engine
This is Rietveld 408576698