Open Bug 1389122 Opened 7 years ago Updated 2 years ago

Vertical flex container does not correctly auto-size on the main axis when it contains a flexed item

Categories

(Core :: Layout, defect, P3)

52 Branch
defect

Tracking

()

UNCONFIRMED
Tracking Status
firefox57 --- wontfix

People

(Reporter: pguerrant, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce:

Run the attached test case


Actual results:

vertical flex boxes have 0 height


Expected results:

all 4 boxes should be 50px by 50px


If the container has no specified height the flex on the item should be ignored and the container should size to fit the item.
Component: Untriaged → Layout: R & A Pos
Product: Firefox → Core
Summary: Absolutely positioned vertical flex container does not correctly auto-size on the main axis when it contains a flexed item → Vertical flex container does not correctly auto-size on the main axis when it contains a flexed item
Attached file testcase 2 (reduced)
Thanks for the bug report!

This isn't specific to absolute positioning -- here's a simplified testcase without any abspos stuff.
(In reply to pguerrant from comment #0)
> Expected results:
> 
> all 4 boxes should be 50px by 50px
> 
> If the container has no specified height the flex on the item should be
> ignored and the container should size to fit the item.

So, two things:
 (1) Our implementation here is based on some older spec-text (and bug 1055887 is filed on updating to match newer spec text).  So this is kind of a version of that bug (and it's useful to have this testcase as a real-world example).  I'm marking this as a dependency of that bug for now.

 (2) The *current* spec-text actually *does* call for 0-sized elements in this case! This was not the spec authors' intention, but it actually ended up being what the spec requires -- and I filed https://github.com/w3c/csswg-drafts/issues/1435 on it a little while back. See discussion there -- basically, flex items' contributions to their container's main-size (height in this case) is currently supposed to be dependent on their "max-content main size", which is 0 if they don't have any content. This will hopefully change in the spec, but we probably won't fix  bug 1055887 until that's sorted out.
Depends on: 1055887
Component: Layout: R & A Pos → Layout
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: