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] Resolve first-valid() at parse time #10989

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

[css-values-5] Resolve first-valid() at parse time #10989

cdoublev opened this issue Oct 2, 2024 · 0 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Oct 2, 2024

The current definition says:

If none of the arguments represent a valid value for the property, the property is invalid at computed-value time.

But in the discussion before the resolution to add first-valid():

This would go away at parse time?

Correct.

And in a comment before:

When does it resolve?

Parse time. [...]

What if all values are invalid?

[...]

.foo { display: grid; display: first-supported(foo; bar); }

If it's resolved at parse time in standard properties, and all specified values are invalid, is the declaration dropped, producing display: grid? Or display becomes invalid at computed-value time?

Parse failure.

This discussion/comment happened before the commit adding first-valid(), so forgive me if I am missing other discussions and if the current text is intentional.

If not, does "go away at parse time" mean it should serialize with the first valid value?

When validating at parse time, the value for a "manual" fallback, for UAs that do not support first-valid(), is not required as an argument of first-valid():

div {
  /* validation at computed value time */
  color: red; /* for UAs that do not support first-valid() */
  color: first-valid(unsupported-color-name, red);
  /* validation at parse time */
  color: red; /* for UAs that do not support first-valid() */
  color: first-valid(unsupported-color-name);
}
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

1 participant