Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Computed value CSS gradients need to serialize colors in their comput…
…ed form https://bugs.webkit.org/show_bug.cgi?id=246927 Reviewed by Darin Adler. Converts StyleGradientImage to store color stop colors as StyleColors rather than keeping the primitive values. This is the intended model of the Style classes (storing Style types rather than CSS types) and is now possible that the spec requires that the computed value not maintain the specified values (e.g. we use `rgb(255, 0, 0)` and not `red` if `red` was specified). * LayoutTests/fast/gradients/css3-gradient-parsing-expected.txt: * LayoutTests/fast/gradients/css3-gradient-parsing.html: * LayoutTests/fast/gradients/unprefixed-gradient-parsing-expected.txt: * LayoutTests/fast/gradients/unprefixed-gradient-parsing.html: Update tests to check both specified and computed forms. * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/background-image-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-image-source-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-source-computed.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-computed.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-lists/animations/list-style-image-interpolation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-image-computed.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt: Update results for new serialization behavior,. * LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-computed.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-substitution-background-properties.html: Import new version of the tests that checks the new computed form. * Source/WebCore/css/CSSGradientValue.cpp: (WebCore::computeStyleGradientImageStopColor): (WebCore::CSSGradientValue::computeStops const): Convert to StyleImage. * Source/WebCore/css/StyleColor.cpp: (WebCore::StyleColor::resolveColorWithoutCurrentColor const): Deleted. * Source/WebCore/css/StyleColor.h: Remove unused (and dangerous if used wrong) function. * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::autoFillStrongPasswordMaskImage): Update for simplified StyleGradientImage::Stop. * Source/WebCore/rendering/style/StyleGradientImage.cpp: (WebCore::operator==): (WebCore::stopsAreCacheable): (WebCore::resolveColorStopColor): (WebCore::StyleGradientImage::StyleGradientImage): (WebCore::computedStyleValueForColorStopColor): (WebCore::StyleGradientImage::computedStyleValue const): (WebCore::StyleGradientImage::image const): (WebCore::StyleGradientImage::knownToBeOpaque const): (WebCore::StyleGradientImage::computeStops const): (WebCore::StyleGradientImage::hasColorDerivedFromElement const): Deleted. (WebCore::StyleGradientImage::isCacheable const): Deleted. * Source/WebCore/rendering/style/StyleGradientImage.h: Rathen than storing a CSSPrimitiveValue for the stop color, we can use a StyleColor and remove the extra Color member entirely. Now that we don't have the CSSPrimitiveValue, we need to compute the CSS value for the color stops when creating a computed value. This happens to give us the correct new behavior of having them fully resolved. * Source/WebCore/style/StyleBuilderState.h: Remove function definition with no body. Canonical link: https://commits.webkit.org/256073@main
- Loading branch information