DescriptionFlexbox 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 : #Messages
Total messages: 12 (0 generated)
|