[css-houdini-drafts] [css-properties-values-api-1] `CSSPropertyRule.initialValue` should not be nullable (#1115)

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

== [css-properties-values-api-1] `CSSPropertyRule.initialValue` should not be nullable ==
The spec says it is nullable / it may not be present:

  > `initialValue, of type CSSOMString, readonly, nullable`
  >
  > The initial value associated with the `@property` rule, which may not be present.

https://drafts.css-houdini.org/css-properties-values-api-1/#dom-csspropertyrule-initialvalue

But also:

  > If the value of the syntax descriptor is the universal syntax definition, then the initial-value descriptor is optional. If omitted, the initial value of the property is the guaranteed-invalid value.
  >
  > Otherwise, [...] The `initial-value` descriptor must be present.

https://drafts.css-houdini.org/css-properties-values-api-1/#initial-value-descriptor

So when the descriptor declaration is omitted, it seems the attribute should serialize the guaranteed-invalid value, which serializes to empty string.

In Chrome:

```js
const styleSheet = new CSSStyleSheet()
styleSheet.insertRule(`
  @property --custom {
    inherits: false;
    syntax: "*";
  }
`)
styleSheet.cssRules.length; // 1
styleSheet.cssRules[0].initialValue; // null
```

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


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

Received on Wednesday, 8 November 2023 10:40:38 UTC