Skip to content

[css-sizing] Aspect-ratio min-size needs to check for "auto", not non-zero #4217

Closed

Description

@tabatkins

In https://drafts.csswg.org/css-sizing-3/#intrinsic:

Otherwise if the box has a definite non-zero min-width or min-height, use that size and calculate the other dimension using the aspect ratio; if both dimensions have a definite minimum, choose the one that results in the larger overall size.

This should probably be checking for non-"auto", not non-zero. (Open ranges are bad.)

Activity

  1. fantasai commented on Dec 12, 2019

    @fantasai
    Collaborator

    Checked for definite generally, since min-content and percentages are non-auto but still problematic. Lmk if that seems correct.

    CC @Loirooriol for sanity-checking :)

  2. Loirooriol commented on Dec 13, 2019

    @Loirooriol
    Contributor

    @fantasai I think that could clarify that the value to be checked for definiteness is the computed value, not the used value, since in most cases an auto minimum size resolves to a definite 0.

  3. fantasai commented on Aug 11, 2020

    @fantasai
    Collaborator

    It's currently specced as if the box has a [=definite=] non-''min-width/auto'' value, thanks to ce03a20 ...

  4. tabatkins commented on Aug 11, 2020

    @tabatkins
    MemberAuthor

    @Loirooriol We went ahead and simplified it further, to explicitly check for a computed <length>. Since this isn't matching impls or anything, just trying to make a slightly smarter default than 300x150, we figure that's probably okay. This work for you?

  5. Loirooriol commented on Aug 23, 2020

    @Loirooriol
    Contributor

    Checking for a computed <length> seems a bit strange to me, because 100% is a <percentage>, but calc(100% + 100px) is a <length> when used in min-width if I get https://drafts.csswg.org/css-values-4/#determine-the-type-of-a-calculation right?

  6. tabatkins commented on Oct 13, 2020

    @tabatkins
    MemberAuthor

    Not quite! Following the definitions, the type of 100% + 100px is obtained by adding the types of 100% and 100px; following that link to TypedOM, we find that the resulting type is "length, with a percent hint set to length".

    Then, a calc() matches a production if its type matches that production; following the link again to TypedOM, a type with a percent hint can not match <length> (because it contains a non-resolved percentage that we're inferring to be compatible with <length>).

  7. tabatkins commented on Oct 13, 2020

    @tabatkins
    MemberAuthor

    @Loirooriol So, with that explanation, does the spec seem okay?

  8. Loirooriol commented on Oct 13, 2020

    @Loirooriol
    Contributor

    Yes, then it looks good to me

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