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

To clarify my point...

Returning `null` instead of empty string from `CSSPropertyRule.initialValue` when the descriptor is omitted, seems inappropriate, because its actual value is the guaranteed-invalid value, which is represented (serialized) with an empty string.

To add some arguments...

Similarly, `style.getPropertyValue('any-undeclared-property')` returns an empty string, and when any `@counter-style` descriptor is omitted, the corresponding attribute returns empty string. (Their actual value is not the guaranteed-invalid value though).

To give an explicit suggestion:

```diff
-   readonly attribute CSSOMString? initialValue;
+   readonly attribute CSSOMString initialValue;
```

```diff
-  - initialValue, of type CSSOMString, readonly, nullable
-    The initial value associated with the @property rule, which may not be present.
+
+  - initialValue, of type CSSOMString, readonly
+    The initial value associated with the @property,
+    or empty string when the descriptor was not specified in the associated rule.
```

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


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

Received on Monday, 4 November 2024 10:39:13 UTC