[webkit-changes] [WebKit/WebKit] add5da: REGRESSION (262875 at main): animation of `rotate` pr...

Antoine Quint noreply at github.com
Wed Oct 18 00:24:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: add5da728e896225eed1c51f5328897bdbf51cbf
      https://github.com/WebKit/WebKit/commit/add5da728e896225eed1c51f5328897bdbf51cbf
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2023-10-18 (Wed, 18 Oct 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes.html
    M Source/WebCore/platform/graphics/GraphicsLayer.h
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
    M Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
    M Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp

  Log Message:
  -----------
  REGRESSION (262875 at main): animation of `rotate` property doesn't work if there's a `scale`
https://bugs.webkit.org/show_bug.cgi?id=260255
rdar://113999490

Reviewed by Dean Jackson.

When we fixed bug 255338 in 262875 at main, we made it so that adding a GraphicsLayer animation with a given name
would remove any existing animation of that same name. That animation's name is the name of the KeyframeEffect
that yielded this GraphicsLayer animation.

However, in RenderLayerBacking::startAnimation(), effects that animate multiple transform-related properties will
yield one GraphicsLayer animation per property, all using the same name. As such, animating both the `rotate` and
`scale` properties, for instance, will add first the `rotate` animation, and then add the `scale` animation which
will have the unwanted effect of removing the prior `rotate` animation since both animations share the same name.

So we now pass an optional property name to `GraphicsLayerCA::removeAnimation()` such that we check both the name
and the property before removing a pre-existing animation when adding a new animation under
`GraphicsLayerCA::createTransformAnimationsFromKeyframes()`.

In the meantime, we make sure to pass `std::nullopt` in `RenderLayerBacking::animationFinished()` in order to
remove *all* animations.

* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/scale-and-rotate-both-specified-on-animation-keyframes.html: Added.
* Source/WebCore/platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::removeAnimation):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::removeAnimation):
* Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::removeAnimation):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::animationFinished):

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




More information about the webkit-changes mailing list