Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Support extended color animation interpolation
https://bugs.webkit.org/show_bug.cgi?id=245645 <rdar://100437917> Reviewed by Dean Jackson and Antti Koivisto. Adds support for animating non-sRGB colors by using the new default interpolation method, OKLab, for cases where one or more of the two keyframes in an animation interpolation are specified using a non-legacy color syntax (e.g. color(), lch(), etc.). For now, there is no syntax for specifying a specific interpolation method to use, as none has been specified yet, so only the two default spaces, sRGB for legacy and OKLab for non-legacy are available. * LayoutTests/imported/w3c/web-platform-tests/css/css-color/animation/color-interpolation-expected.txt: Update results for additional passing test cases. * Source/WebCore/platform/graphics/ColorBlending.cpp: (WebCore::requiresLegacyInterpolationRules): Helper to choose which kind of interpolation to use. (WebCore::blend): When using the legacy path, also continue to clamp to the 8-bit per channel sRGB to avoid any change for existing content. * Source/WebCore/platform/graphics/ColorNormalization.h: (WebCore::makeColorTypeByNormalizingComponents): (WebCore::makeColorTypeByNormalizingComponents<HWBA<float>>): Interpolation can produce negative and otherwise out of range values, so ensure we clamp here. Fixes test case where the progress was set to -0.3. Canonical link: https://commits.webkit.org/254960@main
- Loading branch information