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] Should progress functions have a calculation tree as their internal representation? #10979

Open
cdoublev opened this issue Oct 1, 2024 · 2 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Oct 1, 2024

Like math functions. This would help to clarify:

  • how to determine their type when they are used in a calculation
  • whether the result of progress() can be unwrapped during the simplification of a calculation tree
  • whether their resolved value should be clamped to the range allowed in the target context
  • whether calc(progress(...)) should serialize as is or with progress(...) as a component of a declared value
@tabatkins
Copy link
Member

I've now (in 5afd5de) marked progress() as a math function, so it gets caught by the general terminology about internal representation.

The other two are not math functions, just ordinary functions that resolve to a number, and evaluate their own calculation arguments in a special context. I've added a bit of text to Values 4 (in https://drafts.csswg.org/css-values-4/#calc-type-checking) about how contexts get determined, which hopefully makes this clearer.

@cdoublev
Copy link
Collaborator Author

cdoublev commented Oct 9, 2024

Thank you, this is useful.

About clarifying how to determine the type of media-progress(), container-progress(), and also tree-counting functions... the specs are actually already clear: they are <number>s.

Anything else is a terminal value, whose type is determined based on its CSS type.

For what is worth, I prefer to not consider them as <number>s, but as resolving to a <number>.

Anyway, I am more interested in the observable output. For exemple, whether calc(media-progress(...)) should serialize with or without calc(), and whether media-progress() matching <integer> should be clamped at computed-value time.

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

2 participants