Skip to content

[css-values-5] Receive comma-separated arguments in *-progress() #10862

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

Closed
cdoublev opened this issue Sep 10, 2024 · 3 comments
Closed

[css-values-5] Receive comma-separated arguments in *-progress() #10862

cdoublev opened this issue Sep 10, 2024 · 3 comments

Comments

@cdoublev
Copy link
Collaborator

All math and mix functions receive comma-separated arguments whereas progress functions receive keyword-separated arguments.

What is the reason for this difference? Does this makes up for the inconsistent and more verbose syntax, which is somewhat unusual for a CSS function?

Nit: since progress functions can be used in math functions, which are internally represented with a calculation tree, you can no longer assume that any operator node representing a function (assuming progress functions are represented as operators) should serialize with its values joined with , ; this information must be preserved.

cdoublev added a commit to cdoublev/css that referenced this issue Sep 10, 2024
Temporary fix to serialize *-progress() nested in math functions, which
serialized with comma-separated arguments (cf. w3c/csswg-drafts#10862).
Test cases will come in later commits.

2427f88 introduced a change to wrap the arguments of some calculation
functions in list(), which fixed serializing top-level *-progress(), but
it is inconsistent with other calculation functions, so it now only
applies to *-progress().
@fantasai
Copy link
Collaborator

Thanks for pointing this out! I had noticed it and then forgot to follow up. I don't mind too much if mix() and progress() differ from the rest of the math functions, but those two have a very similar structure and should probably be consistent.

@tabatkins
Copy link
Member

I agree that mix() and the progress functions should be consistent in their syntax, since they're doing such similar things. mix() doesn't have any choice - because it's using <whole-value>, the only choice for its separators are (upgradeable) commas; keywords are absolutely no-go. So that suggests we should shift the progress functions over to just being comma-separated arguments.

@fantasai
Copy link
Collaborator

fantasai commented Oct 8, 2024

Apparently I did notice, and filed this as #10489 :P Closing as a dup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Thursday morning
Development

No branches or pull requests

3 participants