Changeset 255810 in webkit


Ignore:
Timestamp:
Feb 5, 2020 3:51:40 AM (4 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Canceling an accelerated animation before it was committed does not prevent it from playing
https://bugs.webkit.org/show_bug.cgi?id=207253
<rdar://problem/59143624>

Reviewed by Antti Koivisto.

Source/WebCore:

Test: webanimations/accelerated-animation-canceled-before-commit.html

Merely checking whether an accelerated animation is running prior to enqueuing an action to cancel it is not sufficient
since there could be an uncommitted change to start it upon the next animation frame. The same logic would need to apply
in other situations where the playback state changes for a potentially in-flight animation.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::animationDidSeek):
(WebCore::KeyframeEffect::animationWasCanceled):
(WebCore::KeyframeEffect::willChangeRenderer):
(WebCore::KeyframeEffect::animationSuspensionStateDidChange):

LayoutTests:

Add a new test that checks that an accelerated animation that has been enqueued to start but has
not yet been committed is correctly canceled when the cancel() method is called. This test fails
prior to this source change.

  • webanimations/accelerated-animation-canceled-before-commit-expected.html: Added.
  • webanimations/accelerated-animation-canceled-before-commit.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r255787 r255810  
     12020-02-05  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Canceling an accelerated animation before it was committed does not prevent it from playing
     4        https://bugs.webkit.org/show_bug.cgi?id=207253
     5        <rdar://problem/59143624>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add a new test that checks that an accelerated animation that has been enqueued to start but has
     10        not yet been committed is correctly canceled when the cancel() method is called. This test fails
     11        prior to this source change.
     12
     13        * webanimations/accelerated-animation-canceled-before-commit-expected.html: Added.
     14        * webanimations/accelerated-animation-canceled-before-commit.html: Added.
     15
    1162020-02-04  Lauro Moura  <lmoura@igalia.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r255790 r255810  
     12020-02-05  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Canceling an accelerated animation before it was committed does not prevent it from playing
     4        https://bugs.webkit.org/show_bug.cgi?id=207253
     5        <rdar://problem/59143624>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Test: webanimations/accelerated-animation-canceled-before-commit.html
     10
     11        Merely checking whether an accelerated animation is running prior to enqueuing an action to cancel it is not sufficient
     12        since there could be an uncommitted change to start it upon the next animation frame. The same logic would need to apply
     13        in other situations where the playback state changes for a potentially in-flight animation.
     14
     15        * animation/KeyframeEffect.cpp:
     16        (WebCore::KeyframeEffect::animationDidSeek):
     17        (WebCore::KeyframeEffect::animationWasCanceled):
     18        (WebCore::KeyframeEffect::willChangeRenderer):
     19        (WebCore::KeyframeEffect::animationSuspensionStateDidChange):
     20
    1212020-02-05  Philippe Normand  <philn@igalia.com>
    222
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r255663 r255810  
    13861386    // There is no need to seek if we're not playing an animation already. If seeking
    13871387    // means we're moving into an active lexicalGlobalObject, we'll pick this up in apply().
    1388     if (m_isRunningAccelerated)
     1388    if (m_isRunningAccelerated || isAboutToRunAccelerated())
    13891389        addPendingAcceleratedAction(AcceleratedAction::Seek);
    13901390}
     
    13921392void KeyframeEffect::animationWasCanceled()
    13931393{
    1394     if (m_isRunningAccelerated)
     1394    if (m_isRunningAccelerated || isAboutToRunAccelerated())
    13951395        addPendingAcceleratedAction(AcceleratedAction::Stop);
    13961396}
     
    13981398void KeyframeEffect::willChangeRenderer()
    13991399{
    1400     if (m_isRunningAccelerated)
     1400    if (m_isRunningAccelerated || isAboutToRunAccelerated())
    14011401        addPendingAcceleratedAction(AcceleratedAction::Stop);
    14021402}
     
    14041404void KeyframeEffect::animationSuspensionStateDidChange(bool animationIsSuspended)
    14051405{
    1406     if (m_isRunningAccelerated)
     1406    if (m_isRunningAccelerated || isAboutToRunAccelerated())
    14071407        addPendingAcceleratedAction(animationIsSuspended ? AcceleratedAction::Pause : AcceleratedAction::Play);
    14081408}
Note: See TracChangeset for help on using the changeset viewer.