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

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-5] Resolve `first-valid()` at parse time ==
The current [definition](https://drafts.csswg.org/css-values-5/#first-valid) 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](https://github.com/w3c/csswg-drafts/issues/5055#issuecomment-1022425917) 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()`:

```css
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);
}
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10989 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 October 2024 07:59:51 UTC