Changeset 266789 in webkit


Ignore:
Timestamp:
Sep 9, 2020 11:12:16 AM (4 years ago)
Author:
graouts@webkit.org
Message:

REGRESSION (r264856): updating easing on accelerated animation results in incorrect playback
https://bugs.webkit.org/show_bug.cgi?id=215853
<rdar://problem/67815853>

Reviewed by Simon Fraser.

Source/WebCore:

Stop accelerated animations if the timing function has changed in a way that makes it so that it should
no longer play accelerated, but otherwise simply update their timing properties such that may keep
playing.

Test: webanimations/accelerated-animation-easing-update-after-pause.html

webanimations/accelerated-animation-easing-update-steps-after-pause.html

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::canBeAccelerated const):
(WebCore::KeyframeEffect::updateAcceleratedActions):
(WebCore::KeyframeEffect::animationDidChangeTimingProperties):

  • animation/KeyframeEffect.h:

LayoutTests:

Add new tests that check that updating an animation's easing does not stop it.

  • platform/win/TestExpectations:
  • webanimations/accelerated-animation-easing-update-after-pause-expected.html: Added.
  • webanimations/accelerated-animation-easing-update-after-pause.html: Added.
  • webanimations/accelerated-animation-easing-update-steps-after-pause-expected.html: Addded.
  • webanimations/accelerated-animation-easing-update-steps-after-pause.html: Addded.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266786 r266789  
     12020-09-09  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION (r264856): updating easing on accelerated animation results in incorrect playback
     4        https://bugs.webkit.org/show_bug.cgi?id=215853
     5        <rdar://problem/67815853>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add new tests that check that updating an animation's easing does not stop it.
     10
     11        * platform/win/TestExpectations:
     12        * webanimations/accelerated-animation-easing-update-after-pause-expected.html: Added.
     13        * webanimations/accelerated-animation-easing-update-after-pause.html: Added.
     14        * webanimations/accelerated-animation-easing-update-steps-after-pause-expected.html: Addded.
     15        * webanimations/accelerated-animation-easing-update-steps-after-pause.html: Addded.
     16
    1172020-09-09  Hector Lopez  <hector_i_lopez@apple.com>
    218
  • trunk/LayoutTests/platform/win/TestExpectations

    r266665 r266789  
    45544554
    45554555webkit.org/b/215930 webanimations/accelerated-css-transition-with-easing-y-axis-above-1.html [ Skip ]
     4556webkit.org/b/216313 webanimations/accelerated-animation-easing-update-after-pause.html [ Skip ]
     4557webkit.org/b/216313 webanimations/accelerated-animation-easing-update-steps-after-pause.html [ Skip ]
    45564558
    45574559# This test requires the OS to have a font that supports the Ahom language.
  • trunk/Source/WebCore/ChangeLog

    r266788 r266789  
     12020-09-09  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION (r264856): updating easing on accelerated animation results in incorrect playback
     4        https://bugs.webkit.org/show_bug.cgi?id=215853
     5        <rdar://problem/67815853>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Stop accelerated animations if the timing function has changed in a way that makes it so that it should
     10        no longer play accelerated, but otherwise simply update their timing properties such that may keep
     11        playing.
     12
     13        Test: webanimations/accelerated-animation-easing-update-after-pause.html
     14              webanimations/accelerated-animation-easing-update-steps-after-pause.html
     15
     16        * animation/KeyframeEffect.cpp:
     17        (WebCore::KeyframeEffect::canBeAccelerated const):
     18        (WebCore::KeyframeEffect::updateAcceleratedActions):
     19        (WebCore::KeyframeEffect::animationDidChangeTimingProperties):
     20        * animation/KeyframeEffect.h:
     21
    1222020-09-09  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r266280 r266789  
    14941494}
    14951495
     1496bool KeyframeEffect::canBeAccelerated() const
     1497{
     1498    return m_acceleratedPropertiesState != AcceleratedProperties::None && !m_someKeyframesUseStepsTimingFunction && !is<StepsTimingFunction>(timingFunction());
     1499}
     1500
    14961501void KeyframeEffect::updateAcceleratedActions()
    14971502{
    1498     if (m_acceleratedPropertiesState == AcceleratedProperties::None || m_someKeyframesUseStepsTimingFunction || is<StepsTimingFunction>(timingFunction()))
     1503    if (!canBeAccelerated())
    14991504        return;
    15001505
     
    15581563{
    15591564    computeSomeKeyframesUseStepsTimingFunction();
    1560     // The timing function can affect whether the platform can run this as an accelerated animation.
    1561     m_runningAccelerated = RunningAccelerated::NotStarted;
    1562 
    1563     // There is no need to update the animation if we're not playing already. If updating timing
    1564     // means we're moving into an active lexicalGlobalObject, we'll pick this up in apply().
    1565     if (isAboutToRunAccelerated())
    1566         addPendingAcceleratedAction(AcceleratedAction::UpdateTiming);
     1565
     1566    if (isRunningAccelerated() || isAboutToRunAccelerated())
     1567        addPendingAcceleratedAction(canBeAccelerated() ? AcceleratedAction::UpdateTiming : AcceleratedAction::Stop);
     1568    else if (canBeAccelerated())
     1569        m_runningAccelerated = RunningAccelerated::NotStarted;
    15671570}
    15681571
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r264856 r266789  
    182182    ExceptionOr<void> processKeyframes(JSC::JSGlobalObject&, JSC::Strong<JSC::JSObject>&&);
    183183    void addPendingAcceleratedAction(AcceleratedAction);
     184    bool canBeAccelerated() const;
    184185    void updateAcceleratedActions();
    185186    void setAnimatedPropertiesInStyle(RenderStyle&, double);
Note: See TracChangeset for help on using the changeset viewer.