Re: [css-houdini-drafts] [css-properties-values-api] `initial-value` for `*` with arbitrary substitution values (#1120)

`initial-value` is technically a descriptor so `var()` parsing should not be triggered as it is only for properties, and `initial-value: var(1)` should be valid at parse time, since `var(1)` matches `<declaration-value>`. This should also apply in `CSS.registerProperty()` ([WPT](https://github.com/web-platform-tests/wpt/blob/72b510aca3019a3f56bc62cfa6b25484ad2231b6/css/css-properties-values-api/register-property-syntax-parsing.html#L251)), unless:

- `initial-value` should be parsed as a property
- `var()` (and other arbitrary substitutions) should always have a valid syntax, even when used in another context than a property value

This should then be explicitly specified in both cases. 

But this is a different problem than a valid `var()`. Please let me know if I should open a separate issue.

---

There are [these lines](https://github.com/web-platform-tests/wpt/blob/72b510aca3019a3f56bc62cfa6b25484ad2231b6/css/css-properties-values-api/at-property.html#L148) on WPT (it is about the first and the third):

  > ```
  > // initial-value: not computationally independent
  > test_descriptor('initial-value', '3em', null, {'syntax': '"<length>"'});
  > test_descriptor('initial-value', 'var(--x)', null);
  > ```

But the spec requires [`initial-value`](https://drafts.css-houdini.org/css-properties-values-api-1/#initial-value-descriptor) to be computationally independent for `@property` to be valid, only when `syntax` is not `*`.

An equivalent [test](https://github.com/web-platform-tests/wpt/blob/72b510aca3019a3f56bc62cfa6b25484ad2231b6/css/css-properties-values-api/register-property-syntax-parsing.html#L252) exists for `CSS.registerProperty()`. So I guess there is a good reason. 

I wonder which one it is, and whether it also applies to other substitution functions like `attr()` or `first-valid()`.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1120#issuecomment-2398936210 using your GitHub account


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

Received on Tuesday, 8 October 2024 06:11:29 UTC