New issue
Advanced search Search tips

Issue 599828 link

Starred by 5 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

flexbox align-content handling & single-line-sizing should depend on "flex-wrap", not number of lines

Reported by zyuzin.v...@gmail.com, Apr 1 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17

Example URL:
http://codepen.io/juwain/pen/GobrVG?editors=1100

Steps to reproduce the problem:
1. Create flex-conteiner and put some flex-items in it. Items should be on one line in flex-container.
2. Set min-height and flex-basis to flex-items.
3. Set flex-wrap: wrap and align-content: flex-end to container.

What is the expected behavior?
Align-content property must align flex-items even there is only one line in flex-container with flex-wrap: wrap.

What went wrong?
Align-content property starts working when there are 2 or more lines of items in flex-container.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes https://bugs.chromium.org/p/chromium/issues/detail?id=324178

Does this work in other browsers? Yes 

Chrome version: 575538bc320e213510be1e66f3521382e615129d-refs/branch-heads/2623@{#657}  Channel: stable
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 21.0 r0

http://lists.w3.org/Archives/Public/www-style/2014Oct/0489.html
https://www.w3.org/TR/css-flexbox-1/#change-201409-align-content-wrapping

Spec has changed. Now align-content depends not on number of lines in flex-container, but on flex-wrap: wrap property only!
 
This works in Safari and Edge, but don't work properly in Chrome, Opera, Firefox and IE.

Comment 2 by kojii@chromium.org, Apr 6 2016

Components: -Blink Blink>Layout>Flexbox
Owner: cbiesin...@chromium.org
Status: Untriaged (was: Unconfirmed)

Comment 3 by e...@chromium.org, Apr 8 2016

Status: Available (was: Untriaged)
Status: Started (was: Available)
For reference this was changed in https://drafts.csswg.org/css-flexbox/#change-201409-align-content-wrapping on 2 Jan 2015
Status: Fixed (was: Started)
Project Member

Comment 8 by bugdroid1@chromium.org, Sep 1 2016

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

commit 112c0577ad48a4cfe0b6046364f67bd97dc14eff
Author: cbiesinger <cbiesinger@chromium.org>
Date: Thu Sep 01 01:54:43 2016

Revert of [css-flexbox] align-content should apply even when there's just a single line (patchset #2 id:20001 of https://codereview.chromium.org/2191683003/ )

Reason for revert:
Caused multiple regressions ( bug 634672 ,  bug 641789 ) and I'd like more time to investigate them before shipping this to users.

Original issue's description:
> [css-flexbox] align-content should apply even when there's just a single line
>
> In Jan 2015 the spec changed in
> https://drafts.csswg.org/css-flexbox/#change-201409-align-content-wrapping
>
> Change our code accordingly. This effectively reverts commit
> 764735dc12285a09a32b7d5ad3a8d6f178b0ab83
>
> BUG=599828
> R=eae@chromium.org,dgrogan@chromium.org
>
> Committed: https://crrev.com/955a53c8bc7f04b4830acabf7291c603314e0a53
> Cr-Commit-Position: refs/heads/master@{#408456}

TBR=dgrogan@chromium.org,eae@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=599828, 634672 , 641789 

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

[modify] https://crrev.com/112c0577ad48a4cfe0b6046364f67bd97dc14eff/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/112c0577ad48a4cfe0b6046364f67bd97dc14eff/third_party/WebKit/LayoutTests/css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html
[modify] https://crrev.com/112c0577ad48a4cfe0b6046364f67bd97dc14eff/third_party/WebKit/LayoutTests/css3/flexbox/flexbox-wordwrap.html
[modify] https://crrev.com/112c0577ad48a4cfe0b6046364f67bd97dc14eff/third_party/WebKit/LayoutTests/css3/flexbox/multiline-align-content.html
[modify] https://crrev.com/112c0577ad48a4cfe0b6046364f67bd97dc14eff/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Project Member

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

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/829b6a7b22da492c51544d1f0e97ac23b5919467

commit 829b6a7b22da492c51544d1f0e97ac23b5919467
Author: Christian Biesinger <cbiesinger@chromium.org>
Date: Fri Sep 02 18:55:18 2016

Revert of [css-flexbox] align-content should apply even when there's just a single line (patchset #2 id:20001 of https://codereview.chromium.org/2191683003/ )

Reason for revert:
Caused multiple regressions ( bug 634672 ,  bug 641789 ) and I'd like more time to investigate them before shipping this to users.

Original issue's description:
> [css-flexbox] align-content should apply even when there's just a single line
>
> In Jan 2015 the spec changed in
> https://drafts.csswg.org/css-flexbox/#change-201409-align-content-wrapping
>
> Change our code accordingly. This effectively reverts commit
> 764735dc12285a09a32b7d5ad3a8d6f178b0ab83
>
> BUG=599828
> R=eae@chromium.org,dgrogan@chromium.org
>
> Committed: https://crrev.com/955a53c8bc7f04b4830acabf7291c603314e0a53
> Cr-Commit-Position: refs/heads/master@{#408456}

TBR=dgrogan@chromium.org,eae@chromium.org
BUG=599828, 634672 , 641789 

Review-Url: https://codereview.chromium.org/2289793003
Cr-Commit-Position: refs/heads/master@{#415844}
(cherry picked from commit 112c0577ad48a4cfe0b6046364f67bd97dc14eff)

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

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

[modify] https://crrev.com/829b6a7b22da492c51544d1f0e97ac23b5919467/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/829b6a7b22da492c51544d1f0e97ac23b5919467/third_party/WebKit/LayoutTests/css3/flexbox/alignContent-applies-with-flexWrap-wrap-with-single-line.html
[modify] https://crrev.com/829b6a7b22da492c51544d1f0e97ac23b5919467/third_party/WebKit/LayoutTests/css3/flexbox/flexbox-wordwrap.html
[modify] https://crrev.com/829b6a7b22da492c51544d1f0e97ac23b5919467/third_party/WebKit/LayoutTests/css3/flexbox/multiline-align-content.html
[modify] https://crrev.com/829b6a7b22da492c51544d1f0e97ac23b5919467/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Status: Assigned (was: Fixed)
Reopening because this got reverted a little while ago. Before relanding, look into  bug 634672  and  bug 641789  and make sure they are working as intended.
Still getting bit by this: https://codepen.io/anon/pen/GEQmGx

When the viewport is small enough, scrolling down doesn't extend the backgrounds of .a and .b like it should.
I accidentally removed original codepen example, so I've recreated one here https://codepen.io/juwain/pen/VXLGJZ.

Thanks for working on it!
I can confirm this is still happening.
"align-content: center" does not do anything in a flexbox with "flex-wrap: wrap" in both Chromium and WebKit.
It works fine in Firefox and Edge.
So, the previous patch for this caused  bug 641789  because we lay out the flex item as fit-content but align it as max-content, which does not work well...
Cc: cbiesin...@chromium.org viswa.karala@chromium.org
 Issue 904833  has been merged into this issue.
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 15

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

commit 2677c38d6bd832609bd631bc9c26655feb295bc7
Author: Christian Biesinger <cbiesinger@chromium.org>
Date: Thu Nov 15 18:57:20 2018

[css-flex] align-content should apply even when there's just a single line

In Jan 2015 the spec changed in
https://drafts.csswg.org/css-flexbox/#change-201409-align-content-wrapping

Change our code accordingly. This effectively reverts commit
crrev.com/290823003 and relands crrev.com/2191683003

align-content-wrap-004 is a test for  bug 641789 , which was a regression
from the previous attempt at landing this patch.

Bug: 599828
Change-Id: I8de127c19203854922eb23a626cee4de9a772f22
Reviewed-on: https://chromium-review.googlesource.com/c/1323906
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608449}
[modify] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/WebKit/LayoutTests/TestExpectations
[rename] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/WebKit/LayoutTests/external/wpt/css/css-flexbox/align-content-wrap-001.html
[rename] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/WebKit/LayoutTests/external/wpt/css/css-flexbox/align-content-wrap-002.html
[rename] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/WebKit/LayoutTests/external/wpt/css/css-flexbox/align-content-wrap-003.html
[add] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/WebKit/LayoutTests/external/wpt/css/css-flexbox/align-content-wrap-004.html
[modify] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/blink/renderer/core/layout/layout_box.cc
[modify] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/blink/renderer/core/layout/layout_box.h
[modify] https://crrev.com/2677c38d6bd832609bd631bc9c26655feb295bc7/third_party/blink/renderer/core/layout/layout_flexible_box.cc

Hi. How to go works? Still has bug in  Chrome 70.0.3538.110v

https://jsfiddle.net/deveb/wk4cq1dn/14/

Sign in to add a comment