[css-color] Enable layout.css.color-mix-multi-color.enabled for multi-color color-mix()
Categories
(Core :: CSS Parsing and Computation, task, P3)
Tracking
()
People
(Reporter: tlouw, Assigned: tlouw)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
I'd like to know the maximum number of colors that can be mixed in the comma list of the current Firefox implementation of color-mix()? Are there any performance issues if this exceeds a certain number, and is a performance test necessary?
| Assignee | ||
Comment 2•2 months ago
|
||
(In reply to 一丝 from comment #1)
I'd like to know the maximum number of colors that can be mixed in the comma list of the current Firefox implementation of color-mix()? Are there any performance issues if this exceeds a certain number, and is a performance test necessary?
In terms of performance, parse time increases linearly per color, but the mixing algorithm is a very right loop doing some floating point math and should not be a performance issue.
Right now there is no color limit (as per spec), but it might be worth adding an artificial limit (100?) to avoid abuse. With the limit in place I don't believe testing for a performance issue would be required.
| Assignee | ||
Comment 4•2 months ago
|
||
After discussing with :emilio, limiting the number of colors in the list doesn’t really solve the underlying issue. Like other CSS functions such as calc(), there’s no practical limit on item count or nesting, and excessive use will simply crash the content process (e.g., via stack overflow).
That said, the performance characteristics remain acceptable: parsing scales linearly, and mixing has minimal overhead. In normal use, this shouldn’t be a problem unless deliberately abused.
Updated•2 months ago
|
Comment 5•2 months ago
|
||
[Why is this notable]: New CSS feature
[Affects Firefox for Android]: yes
[Suggested wording]: The color-mix() function previously accepted only two color values. This limitation has now been removed, allowing the function to accept an arbitrary number of colors.
[Links (documentation, blog post, etc)]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/color-mix
Sebastian
| Assignee | ||
Comment 6•2 months ago
|
||
Enable the pref: layout.css.color-mix-multi-color.enabled
Comment 8•2 months ago
|
||
| bugherder | ||
Comment 9•2 months ago
|
||
| bugherder | ||
Comment 10•2 months ago
|
||
Thanks, added to the Fx150 nightly release notes, please allow 30 minutes for the site to update.
Updated•2 months ago
|
Comment 12•1 month ago
|
||
Are you shipping this with no test at all? In https://phabricator.services.mozilla.com/D278117 you said:
Tests for the serialization is pending here: https://github.com/web-platform-tests/wpt/pull/57234
That PR still hasn't landed.
Updated•1 month ago
|
| Assignee | ||
Comment 13•29 days ago
|
||
Tests are here: https://phabricator.services.mozilla.com/D287969
Description
•