[webkit-changes] [WebKit/WebKit] 89f7f0: [web-animations] refactor animation code related t...

Antoine Quint noreply at github.com
Tue Dec 19 22:24:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 89f7f09d29636e18884c6d74eb2790a0c3db2325
      https://github.com/WebKit/WebKit/commit/89f7f09d29636e18884c6d74eb2790a0c3db2325
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2023-12-19 (Tue, 19 Dec 2023)

  Changed paths:
    M Source/WebCore/animation/BlendingKeyframes.cpp
    M Source/WebCore/animation/BlendingKeyframes.h
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/animation/KeyframeEffect.h

  Log Message:
  -----------
  [web-animations] refactor animation code related to size-dependent transforms
https://bugs.webkit.org/show_bug.cgi?id=266643
rdar://119876112

Reviewed by Simon Fraser.

We have recently (272022 at main) started accounting for whether a keyframe effect is targeting
a transform-related property that is size-dependent. We already had some code that relied
on a similar analysis to determine whether applying a keyframe effect required a forced layout
prior to initiating an accelerated animation.

We move the bits tracking that information from `KeyframeEffect` to `BlendingKeyframes`, which
really is the best place to analyze keyframe data, and use the same bits to determine both
cases described above.

We will add more code to `BlendingKeyframes::analyzeKeyframe()` in the future, removing more code
from `KeyframeEffect` and making the various keyframe iterations we do under `KeyframeEffect::setBlendingKeyframes()`
more efficient.

Finally, note that the code under `KeyframeEffect::computedNeedsForcedLayout()` did not account for
the `translate` property while the code under `KeyframeEffect::computeHasSizeDependentTransform`
did. The logic from the latter is now being used in both cases, meaning we also account for `translate`
to determine whether a forced layout is required. This is the only behavioral change.

* Source/WebCore/animation/BlendingKeyframes.cpp:
(WebCore::BlendingKeyframes::insert):
(WebCore::BlendingKeyframes::analyzeKeyframe):
* Source/WebCore/animation/BlendingKeyframes.h:
(WebCore::BlendingKeyframes::BlendingKeyframes):
(WebCore::BlendingKeyframes::hasWidthDependentTransform const):
(WebCore::BlendingKeyframes::hasHeightDependentTransform const):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::computeHasSizeDependentTransform):
* Source/WebCore/animation/KeyframeEffect.h:

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




More information about the webkit-changes mailing list