Skip to content

[css-flexbox] min size of flex items: specified size has superfluous requirement? #3669

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

Closed
davidsgrogan opened this issue Feb 22, 2019 · 3 comments
Labels
Closed Rejected as Wontfix by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-flexbox-1 Current Work

Comments

@davidsgrogan
Copy link
Member

https://drafts.csswg.org/css-flexbox-1/#min-size-auto says

the content-based minimum size of a flex item is the smaller of its content size suggestion and its specified size suggestion.

Then both content size suggestion and specified size suggestion are clamped by the max main size property if that is definite.

I think specified size doesn't need to be clamped by its max main size property if content size is, because min(min(specified, max), min(content, max)) == min(specified, min(content, max))

If that's right, then the parenthetical can be removed from https://drafts.csswg.org/css-flexbox-1/#specified-size-suggestion

If the item’s computed main size property is definite, then the specified size suggestion is that size (clamped by its max main size property if it’s definite). It is otherwise undefined.

If that's wrong, and there's a case where clamping matters, please let me know so I can implement it in Blink! :)

/cc @cbiesinger

@fantasai fantasai added the css-flexbox-1 Current Work label Apr 18, 2019
@fantasai
Copy link
Collaborator

fantasai commented Apr 18, 2019

I think while you are technically correct, the formula simplifies down in the way you describe, it's easier to understand what's happening if we clamp each input first (that way it's clear no matter what, we've always clamped to the correct range), and then do the comparisons.

UAs are, of course, allowed to optimize however they want, as long as the output is the same. :)

@fantasai
Copy link
Collaborator

Please let me know if you're OK with this conclusion!

@davidsgrogan
Copy link
Member Author

Sounds fine, as long as we're on the same page about behavior, which looks like we are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Wontfix by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-flexbox-1 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants