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-5] Does serializing calc-size() ever change the number of arguments? #10259

Closed
dbaron opened this issue Apr 26, 2024 · 5 comments
Closed

Comments

@dbaron
Copy link
Member

dbaron commented Apr 26, 2024

The definition of calc-size() doesn't mention serialization at all, and I think it probably should. In particular, the question I have about serialization is whether the number of arguments to calc-size() should ever change during a parse-serialize cycle. I think there are three options:

  1. Rerialize to the one-argument form whenever possible, otherwise serialize to the two-argument form. This has the downside that the two-argument form is often clearer, I think.
  2. Remember the number of arguments given and serialize in the form given.
  3. Always serialize to the two-argument form.

Based on what calc-size() does I don't especially like option 1. General principles of CSS serialization probably don't like 3, since shorter forms are generally preferred. And since this question applies to both specified and computed values (though the answer could be different for the two), and option 2 is pretty strange for computed values, I also don't particularly like option 2.

cc @tabatkins

@tabatkins
Copy link
Member

I agree that this needs specification. I lean towards option 3; I agree that in general the two-arg form is clearer.

@dbaron
Copy link
Member Author

dbaron commented May 9, 2024

I've implemented option 3 in Chromium.

@dbaron
Copy link
Member Author

dbaron commented May 9, 2024

Though thinking about it a little more, I think perhaps another argument against option 3 is that, without it, authors basically never need to write the two-argument form. For most things authors want, they just want to wrap one or both of the endpoints of an animation in calc-size(). So having the two-argument form appear for those cases might be confusing.

@tabatkins
Copy link
Member

I'm fine with either 1 or 3, so if you're leaning towards 1 after some thinking, I'm happy to spec that.

@bramus
Copy link
Contributor

bramus commented Sep 4, 2024

With the single-argument form of calc-size() being dropped, I believe this issue may be closed.

@bramus bramus closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants