Changeset 255593 in webkit


Ignore:
Timestamp:
Feb 3, 2020 2:16:46 PM (4 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Accelerated animations don't run until their natural completion
https://bugs.webkit.org/show_bug.cgi?id=207130
<rdar://problem/59106047>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html

webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html

Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
The accelerated animations will be queued for removal in the next animation frame.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):

  • animation/KeyframeEffect.h:
  • animation/KeyframeEffectStack.cpp:

(WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):

LayoutTests:

Add two new tests that ensures that an accelerated animation still yields compositing on an element when
its finished promise is resolved, but that it's no longer the case on the next frame.

This required an existing test to be updated to wait until the next frame before checking the composited
status of an element on which an animation had just completed.

  • compositing/geometry/limit-layer-bounds-opacity-transition.html:
  • webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
  • webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
  • webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
  • webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r255591 r255593  
     12020-02-03  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Accelerated animations don't run until their natural completion
     4        https://bugs.webkit.org/show_bug.cgi?id=207130
     5        <rdar://problem/59106047>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add two new tests that ensures that an accelerated animation still yields compositing on an element when
     10        its finished promise is resolved, but that it's no longer the case on the next frame.
     11
     12        This required an existing test to be updated to wait until the next frame before checking the composited
     13        status of an element on which an animation had just completed.
     14
     15        * compositing/geometry/limit-layer-bounds-opacity-transition.html:
     16        * webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
     17        * webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
     18        * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
     19        * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.
     20
    1212020-02-03  Jacob Uphoff  <jacob_uphoff@apple.com>
    222
  • trunk/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html

    r180441 r255593  
    4141    {
    4242      if (window.testRunner) {
    43         document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
    44         testRunner.notifyDone();
     43          requestAnimationFrame(() => {
     44              document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
     45              testRunner.notifyDone();
     46          })
    4547      }
    4648    }
  • trunk/Source/WebCore/ChangeLog

    r255592 r255593  
     12020-02-03  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Accelerated animations don't run until their natural completion
     4        https://bugs.webkit.org/show_bug.cgi?id=207130
     5        <rdar://problem/59106047>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
     10               webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
     11
     12        Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
     13        The accelerated animations will be queued for removal in the next animation frame.
     14
     15        * animation/KeyframeEffect.cpp:
     16        (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
     17        * animation/KeyframeEffect.h:
     18        * animation/KeyframeEffectStack.cpp:
     19        (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
     20
    1212020-02-03  Jer Noble  <jer.noble@apple.com>
    222
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r255422 r255593  
    11081108}
    11091109
     1110bool KeyframeEffect::isRunningAcceleratedAnimationForProperty(CSSPropertyID property) const
     1111{
     1112    return m_isRunningAccelerated && CSSPropertyAnimation::animationOfPropertyIsAccelerated(property) && m_blendingKeyframes.properties().contains(property);
     1113}
     1114
    11101115void KeyframeEffect::invalidate()
    11111116{
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r255396 r255593  
    149149    enum class Accelerated : uint8_t { Yes, No };
    150150    bool isCurrentlyAffectingProperty(CSSPropertyID, Accelerated = Accelerated::No) const;
     151    bool isRunningAcceleratedAnimationForProperty(CSSPropertyID) const;
    151152
    152153private:
  • trunk/Source/WebCore/animation/KeyframeEffectStack.cpp

    r255383 r255593  
    6464{
    6565    for (auto& effect : m_effects) {
    66         if (effect->isCurrentlyAffectingProperty(property))
     66        if (effect->isCurrentlyAffectingProperty(property) || effect->isRunningAcceleratedAnimationForProperty(property))
    6767            return true;
    6868    }
Note: See TracChangeset for help on using the changeset viewer.