Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

[css-sizing-4] How to handle 0 in aspect-ratio #5557

Closed

Description

@cbiesinger

https://drafts.csswg.org/css-sizing-4/#aspect-ratio

I just noticed that the spec was changed to allow a lot more values. In particular, 0 is now valid for aspect-ratio, but the spec doesn't say how to handle that. I assume it behaves as "auto" but still gets computed as specified?

Activity

  1. cbiesinger commented on Sep 29, 2020

    @cbiesinger
    Author

    Why did you not make it compute to auto? (Also, I don't recall this entire change being discussed in the WG?)

  2. cbiesinger commented on Sep 29, 2020

    @cbiesinger
    Author
  3. BorisChiou commented on Sep 29, 2020

    @BorisChiou
    Contributor

    There is a comment about n/0 and 0/n for aspect-ratio in media query: #3757. And yes, it'd be great to address more about how to handle 0/n and n/0 in the spec.

  4. tabatkins commented on Sep 29, 2020

    @tabatkins
    Member

    It doesn't say how to handle it because there's nothing special to do with it - it acts exactly like you'd expect, similar to values close to it. That is, 0/x acts similar to 0.000000001/x, and same for x/0. Nothing wrong with zeros or infinities here; they're the same as very-small nonzero values or very-large finite values.

    Why did you not make it compute to auto?

    They don't compute to auto because it would violate our 'no open ranges' restriction (giving a substantially different behavior between 0 and .000000000001, potentially exposing UA-specific rounding). Also, there's no reason to, since the behavior at 0 has a simple, clean definition as the limit behavior of it approaching zero.

    (Also, I don't recall this entire change being discussed in the WG?)

    It's just a side-effect of us changing ratios from <integer> to <number>, which we did discuss. I'd have to dig up the issue, but it was definitely discussed in a f2f as well. When it was <integer> we could disallow zero, but as soon as you allow numbers, you have to allow zero because of no-open-ranges.

  5. added
    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.
    on Sep 29, 2020
  6. tabatkins commented on Sep 29, 2020

    @tabatkins
    Member

    (See #4954 for some other discussion on this, including in particular why we defined 0/0 the way we did.)

  7. fantasai commented on Oct 9, 2020

    @fantasai
    Collaborator

    Reopened #4954 since as @cbiesinger points out, this wasn't resolved by the WG and the resolution isn't obvious.

  8. removed
    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.
    on Nov 3, 2020
  9. fantasai commented on Nov 3, 2020

    @fantasai
    Collaborator

    RESOLVED: Treat aspect ratio of 0 or infinity as auto on Thursday 22 October 2020

  10. fantasai commented on Nov 5, 2020

    @fantasai
    Collaborator
  11. fantasai commented on Nov 5, 2020

    @fantasai
    Collaborator

    wpt: css/css-sizing/aspect-ratio/zero-or-infinity-*

  12. tabatkins commented on Nov 9, 2020

    @tabatkins
    Member

    Fixed in 84a573d

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