New issue
Advanced search Search tips

Issue 647694 link

Starred by 11 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Wrapped children of a Flex container collapse.

Reported by jere...@solvebio.com, Sep 16 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Example URL:
http://codepen.io/anon/pen/kkXNQG

Steps to reproduce the problem:
1. Go to http://codepen.io/anon/pen/kkXNQG using the latest Canary version
2. You only see the container element (pink). The inner divs's (blue) height is zero.
3. Go to http://codepen.io/anon/pen/kkXNQG using the latest stable Chrome
4. You will see 2 blue elements separated by a red line

What is the expected behavior?
You expect to see 2 blue elements separated by a red line.

What went wrong?
Wrapped children of the Flex container collapse instead of occupying the available space as it did in the previous stable versions of Chrome.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes Chrome version 53.0.2785.116 (64-bit)

Does this work in other browsers? Yes 

Chrome version: 55.0.2862.0 canary (64-bit)  Channel: canary
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0

Is it a regression or the new way Chrome calculates height of flex children elements?
 

Comment 1 by bokan@chromium.org, Sep 16 2016

Components: -Blink Blink>Layout>Flexbox
Labels: -Type-Bug -OS-Mac Needs-Bisect OS-All Type-Bug-Regression
Status: Untriaged (was: Unconfirmed)
Bisected down to https://chromium.googlesource.com/chromium/src/+log/fcf20f756ec0721d1ef2d2356ed3478fdd09236f..e66c53c6b1b1c62c4a4f1956cf8898b05bf8fea8 but nothing looks especially suspicious. Test team should be able to bisect down to narrower range.
Hm, I would've thought this was caused by https://codereview.chromium.org/2191683003 which is not in that range.

I reverted that change since (see also  bug 646379 ) but this is actually weird because at first sight this looks like it is a two-line flexbox, so that should be unaffected. I will have to take a closer look. Meanwhile, maybe QA can confirm the regression range.

Comment 3 by bokan@chromium.org, Sep 16 2016

Cc: cbiesin...@chromium.org
Labels: -Needs-Bisect
Owner: jfernan...@igalia.com
Status: Assigned (was: Untriaged)
Actually, I managed to get the per-revision bisect going :)

The culprit is https://chromium.googlesource.com/chromium/src/+/fe59cb90e7b08f1faa146088ddbd7589d87eebb5

jfernandez@, ptal. 
It could be related, indeed. I'll take a look ASAP.
After some preliminary analysis I can conclude that https://chromium.googlesource.com/chromium/src/+/fe59cb90e7b08f1faa146088ddbd7589d87eebb5 is not the root cause f this issue.

It seems that the problem is how we initialize the align-content property. Changes to adapt flexbox's alignment properties to the new CSS3 Alignment syntax caused that both properties used the same style initialization function. This is due the fact that now both properties have 'normal' as initial value, while behaving different during layout (flex-start for justify-content, stretch for align-content). 

In order to deal with this new alignment feature, we introduced some checks to use different initial values depending on whether its enable or not. However, we
have kept the shared style initialization function. This caused that align-content is incorrectly initialized to 'flex-start' in the test cases defined in this bug.

With 'align-content' as 'flex-start" the 'stretch' value on the flex item's align-self properties takes no effect, sine there is not available space in the flex lines.
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eeac3e6a187e362d796fa01489927e773be705ac

commit eeac3e6a187e362d796fa01489927e773be705ac
Author: jfernandez <jfernandez@igalia.com>
Date: Tue Sep 20 13:17:19 2016

[css-align] Initial value of align-content should be 'stretch'.

We only allow the new CSS Box Alignment syntax when the Grid Layout
feature is enabled. Due to flexbox backward compatibility we have
implemented a different code path for the style initial/default values
assignment. However, we have incorrectly resolved both align-content
and justify-content to 'flex-start' when grid layout is disabled.

This patch changes the approach, so we set 'normal' (the value specified
by the new syntax) for both properties, but using the values defined in
the old syntax (Flexbox specification) at computed style resolution.

Since 'stretch' is the default value for the align-content property, this
issue implies that any flexbox line with an undefined height will be
laid out incorrectly, if not explicitly set via CSS, because flex items
can't use the available height, even though they use 'stretch' for their
'align-self' properties.

BUG= 647694 

Review-Url: https://codereview.chromium.org/2348273002
Cr-Commit-Position: refs/heads/master@{#419737}

[add] https://crrev.com/eeac3e6a187e362d796fa01489927e773be705ac/third_party/WebKit/LayoutTests/css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
[modify] https://crrev.com/eeac3e6a187e362d796fa01489927e773be705ac/third_party/WebKit/LayoutTests/fast/alignment/ensure-flexbox-compatibility-with-initial-values-expected.txt
[modify] https://crrev.com/eeac3e6a187e362d796fa01489927e773be705ac/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
[modify] https://crrev.com/eeac3e6a187e362d796fa01489927e773be705ac/third_party/WebKit/Source/core/style/ComputedStyle.h

Status: Fixed (was: Assigned)
This issue should be FIXED now. Please, verify it.
Cc: jfernan...@igalia.com ajha@chromium.org
 Issue 648575  has been merged into this issue.
Cc: nyerramilli@chromium.org
 Issue 645808  has been merged into this issue.
Labels: Merge-Request-54
Per the duplicate bugs, this affects Chrome 54, so we should merge this regression fix. I tested the provided testcases and they work for me in Windows Canary.

Comment 11 by dimu@chromium.org, Sep 21 2016

Labels: -Merge-Request-54 Merge-Approved-54 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M54 (branch: 2840)
Please confirm whether this change is baked/verified in Canary and safe to merge?If yes, merge your change to M54 (branch: 2840) ASAP so that we could take this for next Beta Release.
Yes, it has been verified fixed in Canary (see comment 10). I will go ahead and merge this now
Project Member

Comment 14 by bugdroid1@chromium.org, Sep 22 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/72308707baae9aac0bea97387c1b4426bd378f51

commit 72308707baae9aac0bea97387c1b4426bd378f51
Author: Christian Biesinger <cbiesinger@chromium.org>
Date: Thu Sep 22 14:53:48 2016

[css-align] Initial value of align-content should be 'stretch'.

We only allow the new CSS Box Alignment syntax when the Grid Layout
feature is enabled. Due to flexbox backward compatibility we have
implemented a different code path for the style initial/default values
assignment. However, we have incorrectly resolved both align-content
and justify-content to 'flex-start' when grid layout is disabled.

This patch changes the approach, so we set 'normal' (the value specified
by the new syntax) for both properties, but using the values defined in
the old syntax (Flexbox specification) at computed style resolution.

Since 'stretch' is the default value for the align-content property, this
issue implies that any flexbox line with an undefined height will be
laid out incorrectly, if not explicitly set via CSS, because flex items
can't use the available height, even though they use 'stretch' for their
'align-self' properties.

BUG= 647694 

Review-Url: https://codereview.chromium.org/2348273002
Cr-Commit-Position: refs/heads/master@{#419737}
(cherry picked from commit eeac3e6a187e362d796fa01489927e773be705ac)

Review URL: https://codereview.chromium.org/2361733003 .

Cr-Commit-Position: refs/branch-heads/2840@{#490}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/LayoutTests/css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
[modify] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
[modify] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 645867 has been merged into this issue.
Labels: TE-Verified-54.0.2840.41 TE-Verified-M54
Verified the issue on windows 10, Ubuntu 14.04 and Mac 10.11.6 using chrome beta version #54.0.2840.41 as per the comment #0
Observed that the fix is working as expected.

Attaching screenshot for reference

Hence, adding the verified labels.
647694.png
114 KB View Download
Project Member

Comment 17 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/72308707baae9aac0bea97387c1b4426bd378f51

commit 72308707baae9aac0bea97387c1b4426bd378f51
Author: Christian Biesinger <cbiesinger@chromium.org>
Date: Thu Sep 22 14:53:48 2016

[css-align] Initial value of align-content should be 'stretch'.

We only allow the new CSS Box Alignment syntax when the Grid Layout
feature is enabled. Due to flexbox backward compatibility we have
implemented a different code path for the style initial/default values
assignment. However, we have incorrectly resolved both align-content
and justify-content to 'flex-start' when grid layout is disabled.

This patch changes the approach, so we set 'normal' (the value specified
by the new syntax) for both properties, but using the values defined in
the old syntax (Flexbox specification) at computed style resolution.

Since 'stretch' is the default value for the align-content property, this
issue implies that any flexbox line with an undefined height will be
laid out incorrectly, if not explicitly set via CSS, because flex items
can't use the available height, even though they use 'stretch' for their
'align-self' properties.

BUG= 647694 

Review-Url: https://codereview.chromium.org/2348273002
Cr-Commit-Position: refs/heads/master@{#419737}
(cherry picked from commit eeac3e6a187e362d796fa01489927e773be705ac)

Review URL: https://codereview.chromium.org/2361733003 .

Cr-Commit-Position: refs/branch-heads/2840@{#490}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/LayoutTests/css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
[modify] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
[modify] https://crrev.com/72308707baae9aac0bea97387c1b4426bd378f51/third_party/WebKit/Source/core/style/ComputedStyle.h

Sign in to add a comment