Skip to content

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

Closed

Description

@davidsgrogan

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

Activity

  1. fantasai commented on Apr 18, 2019

    @fantasai
    Collaborator

    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. :)

  2. fantasai commented on Apr 18, 2019

    @fantasai
    Collaborator

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

  3. davidsgrogan commented on Apr 18, 2019

    @davidsgrogan
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions