Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-flexbox] clarify whether collapsed flex items influence the flex container's intrinsic main size #5985

Closed
dholbert opened this issue Feb 12, 2021 · 6 comments
Labels
Closed Accepted by CSSWG Resolution css-flexbox-1 Current Work Tested Memory aid - issue has WPT tests

Comments

@dholbert
Copy link
Member

dholbert commented Feb 12, 2021

The "flex container intrinsic main sizes" spec-text (section 9.9.1) doesn't currently say anything special about excluding or special handling for collapsed flex items. It probably should.

I think they are intended to have zero contribution to the container's main size, based on a side-comment in the "Collapsed Items" section, section 4.4 -- that section says: "...collapsing or uncollapsing items may change the flex container’s main size", but never says precisely how. (That section does say that these items turn into zero-main-size "struts", but that happens after the container's intrinsic sizing.)

Probably https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes step 1 needs:

s/For each flex item/For each flex item (excluding collapsed flex items)/

...or something along those lines.

@dholbert dholbert added the css-flexbox-1 Current Work label Feb 12, 2021
@dholbert
Copy link
Member Author

actually, step 3 is the most important step to adjust: add each item’s flex base size to the product of [...]. We need to define things such that this added quantity ends up at 0, for collapsed flex items (or simply exclude collapsed flex items from the "add each item's..." operation here.)

@dholbert
Copy link
Member Author

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1692366 on fixing this in Firefox/Gecko (to exclude collapsed items from the container's main-axis intrinsic sizing)

@fantasai
Copy link
Collaborator

fantasai commented Jun 9, 2021

@dholbert Edits checked in, let us know if we missed anything?
Agenda+ to verify with the CSSWG.

@dholbert
Copy link
Member Author

The edits look good to me. Thanks!

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Flexbox, and agreed to the following:

  • RESOLVED: Accept edits
The full IRC log of that discussion <fantasai> Topic: Flexbox
<TabAtkins> github: https://github.com//issues/5985
<fantasai> github: https://github.com//issues/5985
<fantasai> TabAtkins: just got approval from dholbert so probably easy
<chrishtr> I need to follow up some more on issue 5896, let's cover it another time.
<fantasai> TabAtkins: dholbert noticed that collaped flex items aren't explicitly excluded from intrinsic size calculation
<fantasai> TabAtkins: so we updated to explicitly skip those items
<fantasai> commits are https://github.com/w3c/csswg-drafts/commit/60ffc4058780d832d880a076fe02788f0cc6e8a7
<fantasai> TabAtkins: We made the fix, just wanted WG confirmation it's OK
<cbiesinger> I haven't read the text but your description sounds good
<fantasai> astearns: proposal to accept?
<fantasai> RESOLVED: Accept edits

@tabatkins
Copy link
Member

@tabatkins tabatkins added the Tested Memory aid - issue has WPT tests label Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by CSSWG Resolution css-flexbox-1 Current Work Tested Memory aid - issue has WPT tests
Projects
None yet
Development

No branches or pull requests

4 participants