Re: [csswg-drafts] [css-typed-om-1][css-syntax-3][css-values-4] Clarify interaction between CSSNumericValue.parse() and `simplify a calculation tree` (#9870)

Similarly Chrome Beta now seems to simplify the color components when running `CSSColorValue.parse()`
Percentages also seem to be resolved against their reference value during this simplification.

```js
CSSColorValue.parse('rgb(calc(255 - 128), 127, 127)').r
// CSSUnitValue {value: 127, unit: 'number'}

CSSColorValue.parse('rgb(100%, 100%, 100%)').r
// CSSUnitValue {value: 255, unit: 'number'}
```

It is difficult to write tests for these methods, as long as the simplification is not specified. The expected values depend on whether or not the components are simplified.

-- 
GitHub Notification of comment by johannesodland
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9870#issuecomment-3053423604 using your GitHub account


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

Received on Wednesday, 9 July 2025 17:20:54 UTC