[webkit-changes] [WebKit/WebKit] 6c434b: Computed value CSS gradients need to serialize col...

Sam Weinig noreply at github.com
Thu Oct 27 13:54:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6c434b5464a00be355e52531b1d20d2637e2b295
      https://github.com/WebKit/WebKit/commit/6c434b5464a00be355e52531b1d20d2637e2b295
  Author: Sam Weinig <weinig at apple.com>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade-expected.txt
    M LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade.html
    M LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt
    M LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom.html
    M LayoutTests/fast/gradients/css3-gradient-parsing-expected.txt
    M LayoutTests/fast/gradients/css3-gradient-parsing.html
    M LayoutTests/fast/gradients/unprefixed-gradient-parsing-expected.txt
    M LayoutTests/fast/gradients/unprefixed-gradient-parsing.html
    M LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt
    M LayoutTests/http/wpt/css/css-images-4/conic-gradient-parsing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/background-image-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-image-source-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-computed.sub-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-image-source-computed.sub-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-images/parsing/gradient-interpolation-method-computed.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-lists/animations/list-style-image-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-image-computed.sub-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-substitution-background-properties.html
    M Source/WebCore/css/CSSGradientValue.cpp
    M Source/WebCore/css/CSSGradientValue.h
    M Source/WebCore/css/StyleColor.cpp
    M Source/WebCore/css/StyleColor.h
    M Source/WebCore/html/HTMLInputElement.cpp
    M Source/WebCore/rendering/style/StyleGradientImage.cpp
    M Source/WebCore/rendering/style/StyleGradientImage.h
    M Source/WebCore/style/StyleBuilderState.h

  Log Message:
  -----------
  Computed value CSS gradients need to serialize colors in their computed 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




More information about the webkit-changes mailing list