Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 13c529c28ace81577cfeec0ce964d4d6f31522ad https://github.com/WebKit/WebKit/commit/13c529c28ace81577cfeec0ce964d4d6f31522ad Author: Sam Weinig <wei...@apple.com> Date: 2024-04-25 (Thu, 25 Apr 2024)
Changed paths: M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color.html M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-relative-color-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-out-of-gamut-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-mix-function-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-hwb-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-out-of-gamut-expected.txt M Source/WebCore/css/color/CSSResolvedColorMix.cpp M Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp M Source/WebCore/platform/graphics/ColorConversion.cpp M Source/WebCore/platform/graphics/ColorConversion.h M Source/WebCore/platform/graphics/ColorInterpolation.cpp M Source/WebCore/platform/graphics/ColorModels.h M Source/WebCore/platform/graphics/ColorNormalization.h M Source/WebCore/platform/graphics/ColorSerialization.cpp M Source/WebCore/platform/graphics/ColorTypes.h Log Message: ----------- Re-sync hwb() implementation with the latest spec https://bugs.webkit.org/show_bug.cgi?id=272984 Reviewed by Darin Adler. The CSS Color specification has changed since hwb() was last worked on. This updates things to support: - Modified parsing rules to normalize hue and allow any value for whiteness/blackness, removing all eager whiteness/blackness normalization. - Changes to the types used by the h/w/b/alpha symbols used in the relative color form to always be CSS_NUMBER. - Requirement that the relative form serialize as `color(srgb )`. - Updated conversion rules to account for unbounded range and related changes to HSL conversion. * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-color-mix-function-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-computed-relative-color-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-invalid-relative-color-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-mix-out-of-gamut-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-color-mix-function-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-hwb-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/relative-color-out-of-gamut-expected.txt: Update another good chunk of tests to now pass. * Source/WebCore/platform/graphics/ColorNormalization.h: (WebCore::makeCanonicalColor): Deleted. (WebCore::normalizeClampedWhitenessBlacknessDisallowingNone): Deleted. (WebCore::normalizeClampedWhitenessBlacknessAllowingNone): Deleted. (WebCore::normalizeWhitenessBlackness): Deleted. (WebCore::makeColorTypeByNormalizingComponents<HWBA<float>>): Deleted. (WebCore::makeCanonicalColor<HWBA<float>>): Deleted. * Source/WebCore/platform/graphics/ColorInterpolation.cpp: (WebCore::interpolateColors): * Source/WebCore/css/color/CSSResolvedColorMix.cpp: (WebCore::mixColorComponentsUsingColorInterpolationMethod): Removed last specialization of makeCanonicalColor() and then remove all callers since it now is just a straight creation of Color. * Source/WebCore/css/parser/CSSPropertyParserConsumer+Color.cpp: (WebCore::CSSPropertyParserHelpers::normalizeHWBParametersRaw): (WebCore::CSSPropertyParserHelpers::parseHWBParametersRaw): (WebCore::CSSPropertyParserHelpers::parseRelativeHWBParametersRaw): (WebCore::CSSPropertyParserHelpers::parseNonRelativeHWBParametersRaw): Work to separate parsing and normalization, allowing much of normalization to be reused for all the parsing paths. * Source/WebCore/platform/graphics/ColorTypes.h: Update HWBA to use ExtendedSRGBA as its reference (like HSLA). * Source/WebCore/platform/graphics/ColorConversion.cpp: (WebCore::ExtendedSRGBA<float>>::convert): (WebCore::HWBA<float>>::convert): (WebCore::calculateHSLHue): Deleted. (WebCore::SRGBA<float>>::convert): Deleted. * Source/WebCore/platform/graphics/ColorConversion.h: Update conversion code to use new reference type and updated algorithm. * Source/WebCore/platform/graphics/ColorModels.h: Update component information to new constraints. * Source/WebCore/platform/graphics/ColorSerialization.cpp: (WebCore::serializationForCSS): Ensure we use all the precision available when serializing as color(srgb) for HWBA by converting to ExtendedSRGBA instead of the bounded SRGBA. Update HSLA as well, since that has the same problem. Canonical link: https://commits.webkit.org/277999@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes