-
Notifications
You must be signed in to change notification settings - Fork 661
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
[css-sizing-4] How to handle 0 in aspect-ratio #5557
Comments
Why did you not make it compute to auto? (Also, I don't recall this entire change being discussed in the WG?) |
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. |
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,
They don't compute to auto because it would violate our 'no open ranges' restriction (giving a substantially different behavior between
It's just a side-effect of us changing ratios from |
(See #4954 for some other discussion on this, including in particular why we defined |
There have been a number of spec changes in parsing aspect-ratio: https://drafts.csswg.org/css-sizing-4/#aspect-ratio https://drafts.csswg.org/css-values-4/#ratio-value In particular: - "auto <ratio>" is now a supported syntax, where the ratio is only used as a fallback if there is no intrinsic ratio - The ratio is now a non-negative number instead of a positive integer - The second component of the ratio is optional Note that I believe the last test in contain-intrinsic-size-valid to be incorrect; by my reading only the computed value should be affected, not the serialization. Note open issues: w3c/csswg-drafts#5557 w3c/csswg-drafts#5084 R=futhark@chromium.org, ikilpatrick@chromium.org, mstensho@chromium.org Bug: 1045668, 1083010, 1086606 Change-Id: Iba3588ed98beacd02f77f3bcc19e387b3add4a5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437698 Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#812403}
Reopened #4954 since as @cbiesinger points out, this wasn't resolved by the WG and the resolution isn't obvious. |
RESOLVED: Treat aspect ratio of 0 or infinity as auto on Thursday 22 October 2020 |
wpt: css/css-sizing/aspect-ratio/zero-or-infinity-* |
Fixed in 84a573d |
There have been a number of spec changes in parsing aspect-ratio: https://drafts.csswg.org/css-sizing-4/#aspect-ratio https://drafts.csswg.org/css-values-4/#ratio-value In particular: - "auto <ratio>" is now a supported syntax, where the ratio is only used as a fallback if there is no intrinsic ratio - The ratio is now a non-negative number instead of a positive integer - The second component of the ratio is optional Note that I believe the last test in contain-intrinsic-size-valid to be incorrect; by my reading only the computed value should be affected, not the serialization. Note open issues: w3c/csswg-drafts#5557 w3c/csswg-drafts#5084 R=futhark@chromium.org, ikilpatrick@chromium.org, mstensho@chromium.org Bug: 1045668, 1083010, 1086606 Change-Id: Iba3588ed98beacd02f77f3bcc19e387b3add4a5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437698 Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Auto-Submit: Christian Biesinger <cbiesinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#812403} GitOrigin-RevId: ff0aadc1166c6ed6508d726c01766ec242098136
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?
The text was updated successfully, but these errors were encountered: