Skip to content
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-values-4] Consider changing the specified behavior of <ratio>: 0 / 0 #5084

Closed
emilio opened this issue May 19, 2020 · 8 comments
Closed
Labels
Closed Accepted by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-values-4 Current Work

Comments

@emilio
Copy link
Collaborator

emilio commented May 19, 2020

https://drafts.csswg.org/css-values-4/#ratios says:

The computed value of a is the pair of numbers provided, unless both numbers are zero, in which case the computed value is the pair (1, 0) (same as 1 / 0).

Is there a strong reason this is a computed value change rather than just a "behaves as"?

There isn't really a problem with this, but it feels odd to make it serialize to something else for no good reason, and it seems weird to serialize to 0 / 0 in specified values and 1 / 0 in computed values.

@emilio emilio added the css-values-4 Current Work label May 19, 2020
@Loirooriol
Copy link
Contributor

I guess this can affect interpolations from/to 0 / 0depending on #4953

@tabatkins
Copy link
Member

I don't think that's important, since 0 / 0 is an error case anyway. ^_^

But yeah, I think we were just imprecise in wording there. Should be fine to just make it behave as 1/0, but continue to compute to 0/0, if that's easier/better in the implementation.

@cbiesinger
Copy link

So, in the wpt/css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-valid.html test, it expects that the serialized value of 0/0 is 1/0. The spec only says the computed value should be 1/0. Is the test correct?

@tabatkins
Copy link
Member

It depends on which value is being serialized. The test is incorrect, since it's serializing the specified value; that should still be 0 / 0.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 30, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
pull bot pushed a commit to Alan-love/chromium that referenced this issue Oct 1, 2020
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 1, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 1, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 1, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this issue Oct 1, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}
@tabatkins
Copy link
Member

I've fixed the test, btw.

@cbiesinger
Copy link

I thought I fixed the test :p

@tabatkins
Copy link
Member

lol, i think i didn't merge the PR for mine

ziransun pushed a commit to ziransun/wpt that referenced this issue Oct 6, 2020
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 8, 2020
…only

Automatic update from web-platform-tests
[AspectRatio] Fix incorrect test

As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}

--

wpt-commits: ec588187413435ae7e248a5d2a07846792e44bec
wpt-pr: 25887
@tabatkins
Copy link
Member

All right, I changed the spec to just make 0/0 behave as 1/0, rather than computing to it. This means that a 0/0 ratio will serialize as 0/0 in all value stages.

@tabatkins tabatkins added Closed Accepted by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. labels Oct 8, 2020
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 13, 2020
Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this issue Oct 13, 2020
…only

Automatic update from web-platform-tests
[AspectRatio] Fix incorrect test

As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}

--

wpt-commits: ec588187413435ae7e248a5d2a07846792e44bec
wpt-pr: 25887
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this issue Oct 13, 2020
Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 16, 2020
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 17, 2020
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 17, 2020
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 17, 2020
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}
pull bot pushed a commit to Mu-L/chromium that referenced this issue Oct 17, 2020
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 27, 2020
…t-ratio, a=testonly

Automatic update from web-platform-tests
[AspectRatio] Fix serialization of aspect-ratio

Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}

--

wpt-commits: 8b94afceafbd71defd6e3a1f056321b7788e18c3
wpt-pr: 26148
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this issue Oct 27, 2020
…t-ratio, a=testonly

Automatic update from web-platform-tests
[AspectRatio] Fix serialization of aspect-ratio

Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}

--

wpt-commits: 8b94afceafbd71defd6e3a1f056321b7788e18c3
wpt-pr: 26148
emilio pushed a commit to servo/servo that referenced this issue Feb 26, 2021
Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
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
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
As per w3c/csswg-drafts#5084, serializing
the specified style for 0/0 should remain 0/0; only computed style
should change.

R=futhark@chromium.org

Bug: 1086606
Change-Id: Iedf56b7dbcb3d0268db8d34d5a554c54a3bdafac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439647
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812646}
GitOrigin-RevId: 556b5b3b6e4593cf30992d17c6ba7fc17ab30613
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
Per these conversations:
w3c/csswg-drafts#5084
w3c/csswg-drafts#5561

R=futhark@chromium.org, xiaochengh@chromium.org

Bug: 1045668
Change-Id: I066809e31e4120b0c179235a101db5c74c3dd146
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480064
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818250}
GitOrigin-RevId: 107155624bd4a770cb9e303ca34864ab476ddb24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-values-4 Current Work
Projects
None yet
Development

No branches or pull requests

4 participants