-
Notifications
You must be signed in to change notification settings - Fork 719
[css-flexbox-1] Intrinsic sizing algorithm seems to produce 0 for many common cases #1435
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
Comments
It wasn't explicitly intended, no. But I'm also not sure it's something we actually want to change. ^_^ @fantasai and I will have to think on this. |
I think the options we have are:
I'm not actually sure what's the best idea here. |
Should these be constraining the max-content contribution (to the parent) rather than the max-content size? Otherwise I think it breaks the |
Yeah, it's the max-content contribution of the items / max-content size of the container we're concerned with here. |
The CSS Working Group just discussed
The full IRC log of that discussion |
Edits checked in! @dholbert, would please let me know if they are satisfactory. :) |
Reopening for testcase need. |
Uh oh!
There was an error while loading. Please reload this page.
I'm reviewing @cbiesinger 's testcase for the (not-implemented-anywhere AFAIK) flexbox intrinsic sizing algorithm, over in web-platform-tests/wpt#5791 , and I think we might've uncovered some unintended spec behavior with the intrinsic sizing algorithm. (And maybe it's intended? But it doesn't match biesi's testcase's expectations, so I want to be sure.)
In particular: it seems to me that in many common cases (with empty flex items at least), the algorithm requires that flex items contribute 0 to their container's intrinsic size, and the container will end up with an intrinsic size of 0 as a result.
For example, consider these two cases:
Here, you might reasonably expect that each flex item & flex container to be 200px wide. But in both cases, the algorithm ends up sizing the item & container to 0px. This is because:
flex-basis
orwidth
).flex-basis
doesn't get to clamp their contributions because the items are both growable and shrinkable.This behavior (ending up 0-sized) kind of makes sense, because the items have no content and no
min-width
/max-width
properties, which mean's they're "OK" being 0-sized, in a sense -- there's no overflow. Still: it seems odd for an element withwidth:200px
to end up being 0-sized, in a scenario with no constraints.@tabatkins @fantasai , am I reading the spec correctly here? And is this zero-sizing the intended spec behavior for cases like this?
The text was updated successfully, but these errors were encountered: