-
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-shapes-1] Optional values shouldn't be serialized #8695
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-box <coord-box> can'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-box <coord-box> can'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-box <coord-box> can'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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruud@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1150434}
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruud@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1150434}
1) As per https://drafts.csswg.org/css-box-4/#typedef-coord-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruud@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruud@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruud@chromium.org> Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> 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-box <coord-box> can't be defined with margin-box. 2) "at <position" changes come from 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 <andruudchromium.org> Commit-Queue: Daniil Sakhapov <sakhapovchromium.org> 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<dael_> fantasai: The css shapes spec tries to spec serialization but does a couple of things that don't make sense. In an example it says omitting components shows some default values don't show in serialization.<dael_> fantasai: You can omit @position so taht doesn't make sense. We have interop that we always serialize, but since you can omit you should allow to omit. Shortest serialization principle. <dael_> fantasai: Second is some guidance about avoiding calc and calc transforms, but that conflicts with rules about serializing position in calc. <dael_> fantasai: In this case, should defer to rules in values 4 <TabAtkins> strong +1 to making these consistent now <dael_> astearns: This was written before the rules. Internt was always to be superceeded by calc. Happy to defer to existing text now <dael_> astearns: First bit needs to stay in shapes b/c talks about specific shapes values, right? <dael_> fantasai: I think we just need to correct the example and remove/fix the tests <dael_> astearns: Any concerns about anybody relying on this? I don't think I have any <dael_> astearns: Prop: We fix the example and tests based on it <dael_> astearns: Obj? <dael_> RESOLVED: We fix the example and tests based on it <dael_> astearns: Prop: Remove the part about serializing calc expressions from Shapes spec <dael_> astearns: Obj? <dael_> RESOLVED: Remove the part about serializing calc expressions from Shapes spec <dael_> astearns: Did you happen to look at the tests for serializing calc in Shapes? There may be some that need updates <dael_> fantasai: I think there are tests, but I don't remember where they are <dael_> astearns: Anything else on this one? |
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 `<length-percentage>` for the specified values of `at <position>`, 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 `<length-percentage>` for the specified values of `at <position>`, 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 `<length-percentage>` for the specified values of `at <position>`, 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 `<length-percentage>` for the specified values of `at <position>`, 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 `<length-percentage>` for the specified values of `at <position>`, 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 `<length-percentage>` for the specified values of `at <position>`, 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 <position>
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 <position>
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
<position>
andcalc()
values, which distinguish specified-value and computed-value serializations in very particular ways.Proposal:
at <position>
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: