-
Notifications
You must be signed in to change notification settings - Fork 719
[css-shapes-1] Optional values shouldn't be serialized #8695
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
Comments
+1 to both of these |
I do not think the resolution for #2274 (always serialize with 2 or 4 values) was meant to be taken literally, but for the record (quoted from #368):
Aside It would be nice to clarify if a math function simplified to a numeric value representing a default value can be omitted, like in There seems to have interop on generally not omitting a math function representing a default value. But it is not always simple see #5642 (comment). |
+1 to the proposal to omit the |
We definitely need to omit the |
@tabatkins It's a bit weird to have a magic value by omission, I don't think we have many precedents for such thing? None come to mind right now but I haven't tried too hard... Maybe there should be an |
We do have some behaviors that can only be expressed by omission. I can't name them off the top of my head, but I know they exist because I've been annoyed by them in the past. I'd be fine with adding such a value, but that's a separate issue. |
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) Comes from w3c/csswg-drafts#8695 (comment) Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) Comes from w3c/csswg-drafts#8695 (comment) Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) Comes from w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main@{#1150434}
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main@{#1150434}
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main@{#1150434}
Per #8695 (comment), it'd be great to specify the expected behaviors for interpolation as well, especially for This test expects to do interpolation by assigning |
… a=testonly Automatic update from web-platform-tests Change WPT test for offset-path parsing 1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main@{#1150434} -- wpt-commits: 77e63377e0476fe25da513b11b78f1525c5c91ee wpt-pr: 40120
… a=testonly Automatic update from web-platform-tests Change WPT test for offset-path parsing 1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main{#1150434} -- wpt-commits: 77e63377e0476fe25da513b11b78f1525c5c91ee wpt-pr: 40120 UltraBlame original commit: 6af80ffc63102ca16a772daca958c3ad783d4eab
… a=testonly Automatic update from web-platform-tests Change WPT test for offset-path parsing 1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main{#1150434} -- wpt-commits: 77e63377e0476fe25da513b11b78f1525c5c91ee wpt-pr: 40120 UltraBlame original commit: 6af80ffc63102ca16a772daca958c3ad783d4eab
… a=testonly Automatic update from web-platform-tests Change WPT test for offset-path parsing 1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-boxcan't be defined with margin-box. 2) "at w3c/csswg-drafts#8695 (comment) Resolved here: web-platform-tests/interop#340 Change-Id: I6fe865d5248c7004257cd17669353d810f6e3d09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4551246 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Daniil Sakhapov Cr-Commit-Position: refs/heads/main{#1150434} -- wpt-commits: 77e63377e0476fe25da513b11b78f1525c5c91ee wpt-pr: 40120 UltraBlame original commit: 6af80ffc63102ca16a772daca958c3ad783d4eab
The CSS Working Group just discussed
The full IRC log of that discussion |
edit: I think I misunderstood the resolution (serialize without position when it was omitted, serialize with default position when it was specified), sorry. Off topicShould I cannot find any WPT tests that omit In FF, any combination of But still in FF, any combination of Also, FF omits |
@tabatkins @fantasai so to be clear the expected behavior is to always serialize to a |
Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1823475 gecko-commit: a3e9e98d521c05808ed81bc5e49e9b1f181fa388 gecko-reviewers: emilio
…s. r=emilio Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780
Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1823475 gecko-commit: a3e9e98d521c05808ed81bc5e49e9b1f181fa388 gecko-reviewers: emilio
…s. r=emilio Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780
Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1823475 gecko-commit: a3e9e98d521c05808ed81bc5e49e9b1f181fa388 gecko-reviewers: emilio
@emilio The expected serialization of |
…s. r=emilio Per the spec issue: w3c/csswg-drafts#8695, we should convert the position components into `` for the specified values of `at `, for basic shapes. Also, update shape-outside/values/support/parsing-utils.js a little bit to make sure we convert the absolute length into px if it is in `calc()`, for the specified values. And remove calc() if possible for computed values. Differential Revision: https://phabricator.services.mozilla.com/D188780
Currently the CSS Shapes draft specifies:
This seems mostly fine, except there's a couple problems:
There's an example that says:
which is nonsense, because omitting a default
at
is required by the normative text above.This example is then tested in WPT, which shows that we (unfortunately) have interop on the example rather than on the normative text. However, having special rules that go against our general serialization principles without good reason is an anti-pattern. We should be consistent and allow
at
to be omitted from the serialization just like any other optional component.The guidance about “avoiding calc() expressions where possible, avoiding calc() transformations” conflicts with our more generally-applicable rules about serializing
andcalc()
values, which distinguish specified-value and computed-value serializations in very particular ways.Proposal:
at
to be omitted, consistent with our general serialization principles.calc()
serialization, allowing the spec to defer to the more specific serialization rules in css-values-4.The text was updated successfully, but these errors were encountered: