Csswg-drafts: [css-flexbox] should transferred size suggestion be clamped by max main size?

Created on 25 Mar 2020  路  6Comments  路  Source: w3c/csswg-drafts

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

Both the specified size suggestion and the content size suggestion say "clamped by its max main size property if it鈥檚 definite".

But the transferred size suggestion does not say that. Why not? Is that intentional or an oversight?

/cc @davidsgrogan @fantasai

Closed Accepted as Editorial Commenter Satisfied css-flexbox-1

Most helpful comment

Maybe?

TBH, maybe the best fix would to add the clamping to the text at the beginning, i.e. after this paragraph:

In general, the content-based minimum size of a flex item is the smaller of its content size suggestion and its specified size suggestion. However, if the box has an aspect ratio and no specified size, its content-based minimum size is the smaller of its content size suggestion and its transferred size suggestion. If the box has neither a specified size suggestion nor an aspect ratio, its content-based minimum size is the content size suggestion.

Add:
"In all cases, this size is clamped by the main-axis maximum size, if definite."

All 6 comments

It's strange, because the text in CSS Grid was supposedly copied from Flexbox (7728a3db1e0bfccc355a074013036b5e8288a2a7), but grid does clamp: https://drafts.csswg.org/css-grid/#transferred-size-suggestion

converted through the aspect ratio and finally clamped by the same-axis max size property if it鈥檚 definite.

Does it not matter because we always take the minimum of transferred size suggestion and content size suggestion, and content size suggestion was already clamped?

Maybe?

TBH, maybe the best fix would to add the clamping to the text at the beginning, i.e. after this paragraph:

In general, the content-based minimum size of a flex item is the smaller of its content size suggestion and its specified size suggestion. However, if the box has an aspect ratio and no specified size, its content-based minimum size is the smaller of its content size suggestion and its transferred size suggestion. If the box has neither a specified size suggestion nor an aspect ratio, its content-based minimum size is the content size suggestion.

Add:
"In all cases, this size is clamped by the main-axis maximum size, if definite."

I filed a very similar issue a while back https://github.com/w3c/csswg-drafts/issues/3669

As far as we can tell, the omission from Flexbox was an oversight. We've gone ahead and done the refactoring suggested by @cbiesinger in https://github.com/w3c/csswg-drafts/commit/be54c07f06ce30fcb6d00e85c089d962967a5224, since it clamps at the end of every suggestion algo anyway.

Let us know if this looks okay?

Thanks, that looks good.

Was this page helpful?
0 / 5 - 0 ratings