- From: Guillaume via GitHub <sysbot+gh@w3.org>
- Date: Tue, 08 Mar 2022 15:36:48 +0000
- To: public-css-archive@w3.org
I'm sorry to comment on a 5 years old closed issue but I'm confused by how to serialize `element.style.color = 'green'` and by the terminology used in CSSOM: > - If `<color>` is a component of a resolved value, see [CSS Color 4 § 4.7 Resolving <color> Values](https://www.w3.org/TR/css-color-4/#resolving-color-values). > - If `<color>` is a component of a computed value, see [CSS Color 4 § 4.8 Serializing <color> Values](https://www.w3.org/TR/css-color-4/#serializing-color-values). > - If `<color>` is a component of a specified value, then return the color as follows: > - If the color was explicitly specified by the author, then return the original, author specified color value. > - Otherwise, return the value that would be returned if the color were a component of a computed value. `green` currently serializes to `green` in Chrome/Firefox so I have to assume it is *a component of a resolved value*, which seems to be the only path to get `green` as the output instead of `rgb(0, 255, 0)`. But afaict, a resolved value is only defined in CSSOM as the return value of `getComputedStyle(element).color`, which is `rgb(0, 255, 0)` in this case... My gut first told me that `style.color` is a component of a specified value, but browsers serializes `element.style.color = 'hsl(...)'` to `rgb(...)`, and I can not even see when *the color was explicitly specified by the author* does not apply. -- GitHub Notification of comment by cdoublev Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1004#issuecomment-1061910466 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 8 March 2022 15:36:49 UTC