Re: [csswg-drafts] [css-variables][cssom] Empty value doesn't round-trip (#9847)

The CSS Working Group just discussed `[css-variables][cssom] Empty value doesn't round-trip`, and agreed to the following:

* `RESOLVED: Serialize custom properties with empty value as a single space`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> oriol: In the past, we didn't have any property that would accept empty value as valid<br>
&lt;fantasai> oriol: but we changed custom properties to trim whitespace and accept empty values<br>
&lt;fantasai> oriol: problem is with CSSOM, because in setProperty if you provide an empty string, then instead of trying to set an empty value it behaves as removeProperty<br>
&lt;fantasai> oriol: so if you serialize a custom property that's empty string, it won't round-trip<br>
&lt;fantasai> oriol: Some possible improvements<br>
&lt;fantasai> oriol: 1. For custom properties we could stop doing removeProperty for assigning the empty string.<br>
&lt;fantasai> oriol: but might have some compat problems at this point<br>
&lt;fantasai> oriol: 2. Instead of serializing empty values as empty string, serialize a single space. This will round-trip.<br>
&lt;dbaron> option 2 sounds good to me<br>
&lt;fantasai> oriol: Could also use a comment instead of space, but space seems preferable<br>
&lt;kizu> +1 to a space<br>
&lt;ChrisL> single space seems a good way, to me<br>
&lt;fantasai> +1 to space<br>
&lt;fantasai> astearns: has anyone tried implementing?<br>
&lt;fantasai> oriol: no<br>
&lt;emilio> q+<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> fantasai: I think there's a benefit with being consistent in the way we remove properties<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: +1 to that. Serializing to space is simpler and less inconsistent<br>
&lt;fantasai> astearns: any opinions against?<br>
&lt;fantasai> RESOLVED: Serialize custom properties with empty value as a single space<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9847#issuecomment-2402772528 using your GitHub account


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

Received on Wednesday, 9 October 2024 16:22:37 UTC