⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285728 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 9:40:47 AM (5 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
https://bugs.webkit.org/show_bug.cgi?id=233041
<rdar://problem/85236241>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/accelerated-animation-after-forward-filling-animation.html

When starting an accelerated animation, we would fill any implicit keyframes based on the unanimated style.
We now also apply all animations below this animation in the target's effect stack such that a previous
forward-filling animation is accounted for.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::applyPendingAcceleratedActions):

LayoutTests:

Add a new test that runs a forward-filling animation for transform, waits for its completion,
then runs another transform animation with an implicit initial keyframe, ensuring that the
result of the first forward-filling animation is accounted for when computing the initial
keyframe.

This test would fail prior to this patch.

  • webanimations/accelerated-animation-after-forward-filling-animation-expected.html: Added.
  • webanimations/accelerated-animation-after-forward-filling-animation.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285727 r285728  
     12021-11-12  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     4        https://bugs.webkit.org/show_bug.cgi?id=233041
     5        <rdar://problem/85236241>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test that runs a forward-filling animation for `transform`, waits for its completion,
     10        then runs another `transform` animation with an implicit initial keyframe, ensuring that the
     11        result of the first forward-filling animation is accounted for when computing the initial
     12        keyframe.
     13
     14        This test would fail prior to this patch.
     15
     16        * webanimations/accelerated-animation-after-forward-filling-animation-expected.html: Added.
     17        * webanimations/accelerated-animation-after-forward-filling-animation.html: Added.
     18
    1192021-11-12  Patrick Angle  <pangle@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r285725 r285728  
     12021-11-12  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     4        https://bugs.webkit.org/show_bug.cgi?id=233041
     5        <rdar://problem/85236241>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Test: webanimations/accelerated-animation-after-forward-filling-animation.html
     10
     11        When starting an accelerated animation, we would fill any implicit keyframes based on the unanimated style.
     12        We now also apply all animations below this animation in the target's effect stack such that a previous
     13        forward-filling animation is accounted for.
     14
     15        * animation/KeyframeEffect.cpp:
     16        (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
     17
    1182021-11-12  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r285397 r285728  
    17891789        ASSERT(lastStyleChangeEventStyle);
    17901790
     1791        // We need to resolve all animations up to this point to ensure any forward-filling
     1792        // effect is accounted for when computing the "from" value for the accelerated animation.
     1793        auto underlyingStyle = RenderStyle::clonePtr(*lastStyleChangeEventStyle);
     1794        auto* effectStack = m_target->keyframeEffectStack(m_pseudoId);
     1795        ASSERT(effectStack);
     1796
     1797        for (const auto& effect : effectStack->sortedEffects()) {
     1798            if (this == effect.get())
     1799                break;
     1800            if (auto progress = effect->getComputedTiming().progress)
     1801                effect->setAnimatedPropertiesInStyle(*underlyingStyle, *progress);
     1802        }
     1803
    17911804        KeyframeList explicitKeyframes(m_blendingKeyframes.animationName());
    17921805        explicitKeyframes.copyKeyframes(m_blendingKeyframes);
    1793         explicitKeyframes.fillImplicitKeyframes(*m_target, m_target->styleResolver(), lastStyleChangeEventStyle, nullptr);
     1806        explicitKeyframes.fillImplicitKeyframes(*m_target, m_target->styleResolver(), underlyingStyle.get(), nullptr);
    17941807        return renderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer(), explicitKeyframes) ? RunningAccelerated::Yes : RunningAccelerated::No;
    17951808    };
Note: See TracChangeset for help on using the changeset viewer.