Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 60582f61a44ec4d1ad1c3b7ae313868be8249eda
https://github.com/WebKit/WebKit/commit/60582f61a44ec4d1ad1c3b7ae313868be8249eda
Author: Sam Weinig <[email protected]>
Date: 2026-10-06 (Tue, 06 Oct 2026)
Changed paths:
M Source/WTF/wtf/Vector.h
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp
M Source/WebCore/css/values/color/CSSColorMixResolver.cpp
A Source/WebCore/css/values/primitives/CSSNormalizedMixPercentages.h
M Tools/TestWebKitAPI/Tests/WTF/Vector.cpp
Log Message:
-----------
Add a shared implementation of the "normalize mix percentages" algorithm from
CSS Values 5
https://bugs.webkit.org/show_bug.cgi?id=326434
Reviewed by Darin Adler.
Refactors color-mix() and calc-mix() to use a shared generic implementation of
the "normalize mix percentages"
algorithm from CSS Values 5 -
https://drafts.csswg.org/css-values-5/#normalize-mix-percentages.
The shared implementation returns only the normalized percentages and the
leftover value, so the callers must
use WTF::zippedRange to matchup the normalized percentages with their original
items.
Also adds static Vector::map(), matching what we already have on FixedVector,
to allow easily creating a new
Vector with a specific inline capacity via a mapping.
* Source/WTF/wtf/Vector.h:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/calc/CSSCalcTree+Simplification.cpp:
* Source/WebCore/css/values/color/CSSColorMixResolver.cpp:
* Source/WebCore/css/values/primitives/CSSNormalizedMixPercentages.h: Added.
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:
Canonical link: https://commits.webkit.org/322862@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications