Re: [csswg-drafts] [css-color-hdr] How should checking for percentages summing to 0 work in `dynamic-range-limit-mix()` and `color-mix()` when calc() is used? (#11678)

@weinig @tabatkins For `color-mix()`, since we removed the validity check, it doesn't matter whether the zero percentages are specified with `calc()` or directly as `0%`. So I think the spec is now self-consistent and WPT that check for zero-sum being invalid can be edited to check instead for `transparent`.

Now on to `dynamic-range-limit-mix()`. We removed the invalidity check, so we arrive at [step 6](https://drafts.csswg.org/css-color-hdr/#computing-dynamic-range-limit):

> Otherwise, the computed value is [dynamic-range-limit-mix()](https://drafts.csswg.org/css-color-hdr/#funcdef-dynamic-range-limit-mix), with parameters [standard](https://drafts.csswg.org/css-color-hdr/#valdef-dynamic-range-limit-standard), [constrained-high](https://drafts.csswg.org/css-color-hdr/#valdef-dynamic-range-limit-constrained-high), and [no-limit](https://drafts.csswg.org/css-color-hdr/#valdef-dynamic-range-limit-no-limit), in that order, and percentages p_standard, p_constrained_high, and p_no_limit, omitting parameters with a percentage equal to 0%.

If they all sum to zero then all parameters are omitted, which we can't really have

`dynamic-range-limit-mix()`

so I guess we need an all-zero check that returns the initial value of ``dynamic-range-limit`.

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


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

Received on Wednesday, 26 March 2025 19:34:43 UTC