Add tests for multi-color color-mix() syntax#57234
Open
tiaanl wants to merge 1 commit intoweb-platform-tests:masterfrom
Open
Add tests for multi-color color-mix() syntax#57234tiaanl wants to merge 1 commit intoweb-platform-tests:masterfrom
tiaanl wants to merge 1 commit intoweb-platform-tests:masterfrom
Conversation
9d416d5 to
f1f9893
Compare
svgeesus
reviewed
Jan 21, 2026
| fuzzy_test_valid_color(`color-mix(in srgb, red, green, blue)`, `color-mix(in srgb, red, green, blue)`); // all p? omitted | ||
| fuzzy_test_valid_color(`color-mix(in srgb, red 10%, green 10%, blue 10%)`, `color-mix(in srgb, red 10%, green 10%, blue 10%)`); // all p? equal | ||
| fuzzy_test_valid_color(`color-mix(in srgb, 25% red, 25% green, 25% blue)`, `color-mix(in srgb, red 25%, green 25%, blue 25%)`); // all p? equal | ||
| fuzzy_test_valid_color(`color-mix(in srgb, red 25%, green, blue)`, `color-mix(in srgb, red 25%, green 37.5%, blue 37.5%)`); // only p1 specified |
Contributor
There was a problem hiding this comment.
What does this trailing 37.5%, outside the function, mean?
Contributor
Author
There was a problem hiding this comment.
I think you're referring to an older commit? I omitted the closing paren but fixed it.
Contributor
That seems a reasonable approach for serializing the specified value. I'm working on updating the spec. |
lando-prod-mozilla bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Jan 27, 2026
…reviewers,firefox-style-system-reviewers,dshin The color-mix() function can now take multiple color/percentage pairs and mix them all together using the new algorithm. Tests for the serialization is pending here: web-platform-tests/wpt#57234 Differential Revision: https://phabricator.services.mozilla.com/D278117
github-actions bot
pushed a commit
to longvatrong111/stylo
that referenced
this pull request
Jan 28, 2026
…reviewers,firefox-style-system-reviewers,dshin The color-mix() function can now take multiple color/percentage pairs and mix them all together using the new algorithm. Tests for the serialization is pending here: web-platform-tests/wpt#57234 Differential Revision: https://phabricator.services.mozilla.com/D278117
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These tests focus primarily on percentage serialization when more than two colors are used.
The spec does not currently define clear serialization rules (see w3c/csswg-drafts#13320). The approach taken here is to serialize all percentages when more than two colors are present and the values do not sum to 100%, avoiding implicit normalization.