[webkit-changes] [WebKit/WebKit] fd0581: [web-animations] mask-image should support discret...

Antoine Quint noreply at github.com
Thu Feb 23 12:00:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fd0581b4940cf7594443c2f7b3503a26d4df8c58
      https://github.com/WebKit/WebKit/commit/fd0581b4940cf7594443c2f7b3503a26d4df8c58
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2023-02-23 (Thu, 23 Feb 2023)

  Changed paths:
    R LayoutTests/animations/cross-fade-webkit-mask-image-expected.txt
    R LayoutTests/animations/cross-fade-webkit-mask-image.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-masking/animations/mask-image-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation.html
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-backgrounds/animations/background-image-interpolation-expected.txt
    R LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
    M Source/WebCore/animation/CSSPropertyAnimation.cpp

  Log Message:
  -----------
  [web-animations] mask-image should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=252656

Reviewed by Dean Jackson.

While specifications dictate that <image> properties have a discrete animation type, we actually
interpolate such values by producing a -webkit-cross-fade() value. Chrome also does that, while
Firefox adheres to the spec.

However, in the case of mask-image, Chrome does not cross fade and adheres to the spec, making
WebKit the outlier. We should align with the spec in this regard, which frankly makes more sense
than cross-fading an image used as a mask and thus not rendered.

We had to fix FillLayersPropertyWrapper which incorrectly assumed that the RenderStyle into which
we were blending would have the same number of background or mask layers as the from and to values.
We now correctly repeat previous layers as needed to accommodate for the length of the from and to
values.

Fixing this showed that the WPT test css/css-masking/animations/mask-image-interpolation.html was
incorrect. While it correctly checked the discrete behavior where from / to values switch at the
0.5 progress mark, it failed to use test_no_interpolation() and thus expected interpolation for
CSS Transitions instead of no transition.

Finally, we remove animations/cross-fade-webkit-mask-image.html which is entirely superseded by WPT tests.

* LayoutTests/animations/cross-fade-webkit-mask-image-expected.txt: Removed.
* LayoutTests/animations/cross-fade-webkit-mask-image.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/background-image-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation.html:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-backgrounds/animations/background-image-interpolation-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt: Removed.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:

Canonical link: https://commits.webkit.org/260756@main




More information about the webkit-changes mailing list