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

Changeset 285834 in webkit


Ignore:
Timestamp:
Nov 15, 2021, 2:16:34 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r285728. rdar://problem/85236241

[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285728 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.3.6.1-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.3.6.1-branch/LayoutTests/ChangeLog

    r285693 r285834  
     12021-11-15  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r285728. rdar://problem/85236241
     4
     5    [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     6    https://bugs.webkit.org/show_bug.cgi?id=233041
     7    <rdar://problem/85236241>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebCore:
     12   
     13    Test: webanimations/accelerated-animation-after-forward-filling-animation.html
     14   
     15    When starting an accelerated animation, we would fill any implicit keyframes based on the unanimated style.
     16    We now also apply all animations below this animation in the target's effect stack such that a previous
     17    forward-filling animation is accounted for.
     18   
     19    * animation/KeyframeEffect.cpp:
     20    (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
     21   
     22    LayoutTests:
     23   
     24    Add a new test that runs a forward-filling animation for `transform`, waits for its completion,
     25    then runs another `transform` animation with an implicit initial keyframe, ensuring that the
     26    result of the first forward-filling animation is accounted for when computing the initial
     27    keyframe.
     28   
     29    This test would fail prior to this patch.
     30   
     31    * webanimations/accelerated-animation-after-forward-filling-animation-expected.html: Added.
     32    * webanimations/accelerated-animation-after-forward-filling-animation.html: Added.
     33   
     34    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     35
     36    2021-11-12  Antoine Quint  <graouts@webkit.org>
     37
     38            [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     39            https://bugs.webkit.org/show_bug.cgi?id=233041
     40            <rdar://problem/85236241>
     41
     42            Reviewed by Dean Jackson.
     43
     44            Add a new test that runs a forward-filling animation for `transform`, waits for its completion,
     45            then runs another `transform` animation with an implicit initial keyframe, ensuring that the
     46            result of the first forward-filling animation is accounted for when computing the initial
     47            keyframe.
     48
     49            This test would fail prior to this patch.
     50
     51            * webanimations/accelerated-animation-after-forward-filling-animation-expected.html: Added.
     52            * webanimations/accelerated-animation-after-forward-filling-animation.html: Added.
     53
    1542021-11-11  Alan Coon  <alancoon@apple.com>
    255
  • branches/safari-612.3.6.1-branch/Source/WebCore/ChangeLog

    r285755 r285834  
     12021-11-15  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r285728. rdar://problem/85236241
     4
     5    [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     6    https://bugs.webkit.org/show_bug.cgi?id=233041
     7    <rdar://problem/85236241>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebCore:
     12   
     13    Test: webanimations/accelerated-animation-after-forward-filling-animation.html
     14   
     15    When starting an accelerated animation, we would fill any implicit keyframes based on the unanimated style.
     16    We now also apply all animations below this animation in the target's effect stack such that a previous
     17    forward-filling animation is accounted for.
     18   
     19    * animation/KeyframeEffect.cpp:
     20    (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
     21   
     22    LayoutTests:
     23   
     24    Add a new test that runs a forward-filling animation for `transform`, waits for its completion,
     25    then runs another `transform` animation with an implicit initial keyframe, ensuring that the
     26    result of the first forward-filling animation is accounted for when computing the initial
     27    keyframe.
     28   
     29    This test would fail prior to this patch.
     30   
     31    * webanimations/accelerated-animation-after-forward-filling-animation-expected.html: Added.
     32    * webanimations/accelerated-animation-after-forward-filling-animation.html: Added.
     33   
     34    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     35
     36    2021-11-12  Antoine Quint  <graouts@webkit.org>
     37
     38            [Web Animations] Accelerated animations with a single keyframe don't account for prior forward-filling animations
     39            https://bugs.webkit.org/show_bug.cgi?id=233041
     40            <rdar://problem/85236241>
     41
     42            Reviewed by Dean Jackson.
     43
     44            Test: webanimations/accelerated-animation-after-forward-filling-animation.html
     45
     46            When starting an accelerated animation, we would fill any implicit keyframes based on the unanimated style.
     47            We now also apply all animations below this animation in the target's effect stack such that a previous
     48            forward-filling animation is accounted for.
     49
     50            * animation/KeyframeEffect.cpp:
     51            (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
     52
    1532021-11-12  Russell Epstein  <repstein@apple.com>
    254
  • branches/safari-612.3.6.1-branch/Source/WebCore/animation/KeyframeEffect.cpp

    r278610 r285834  
    17461746        ASSERT(lastStyleChangeEventStyle);
    17471747
     1748        // We need to resolve all animations up to this point to ensure any forward-filling
     1749        // effect is accounted for when computing the "from" value for the accelerated animation.
     1750        auto underlyingStyle = RenderStyle::clonePtr(*lastStyleChangeEventStyle);
     1751        auto* effectStack = m_target->keyframeEffectStack(m_pseudoId);
     1752        ASSERT(effectStack);
     1753
     1754        for (const auto& effect : effectStack->sortedEffects()) {
     1755            if (this == effect.get())
     1756                break;
     1757            if (auto progress = effect->getComputedTiming().progress)
     1758                effect->setAnimatedPropertiesInStyle(*underlyingStyle, *progress);
     1759        }
     1760
    17481761        KeyframeList explicitKeyframes(m_blendingKeyframes.animationName());
    17491762        explicitKeyframes.copyKeyframes(m_blendingKeyframes);
    1750         explicitKeyframes.fillImplicitKeyframes(*m_target, m_target->styleResolver(), lastStyleChangeEventStyle, nullptr);
     1763        explicitKeyframes.fillImplicitKeyframes(*m_target, m_target->styleResolver(), underlyingStyle.get(), nullptr);
    17511764        return renderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer(), explicitKeyframes) ? RunningAccelerated::Yes : RunningAccelerated::No;
    17521765    };
Note: See TracChangeset for help on using the changeset viewer.