Changeset 255371 in webkit


Ignore:
Timestamp:
Jan 29, 2020 11:35:21 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[Web Animations] DeclarativeAnimation for CSS Animation is not always destroyed when class that applies animation-name is removed
https://bugs.webkit.org/show_bug.cgi?id=206899

Patch by Antoine Quint <Antoine Quint> on 2020-01-29
Reviewed by Devin Rousso.

In case after processing the new animation styles we don't have any CSSAnimation objects anymore, we should make sure we remove the entry
for this element from m_elementToCSSAnimationsCreatedByMarkupMap so as to release ownership of any prior animation.

  • animation/AnimationTimeline.cpp:

(WebCore::AnimationTimeline::updateCSSAnimationsForElement):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r255365 r255371  
     12020-01-29  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] `DeclarativeAnimation` for CSS Animation is not always destroyed when class that applies `animation-name` is removed
     4        https://bugs.webkit.org/show_bug.cgi?id=206899
     5
     6        Reviewed by Devin Rousso.
     7
     8        In case after processing the new animation styles we don't have any CSSAnimation objects anymore, we should make sure we remove the entry
     9        for this element from m_elementToCSSAnimationsCreatedByMarkupMap so as to release ownership of any prior animation.
     10
     11        * animation/AnimationTimeline.cpp:
     12        (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
     13
    1142020-01-28  Yusuke Suzuki  <ysuzuki@apple.com>
    215
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r255076 r255371  
    339339    }
    340340
    341     m_elementToCSSAnimationsCreatedByMarkupMap.set(&element, WTFMove(newAnimations));
     341    if (newAnimations.isEmpty())
     342        m_elementToCSSAnimationsCreatedByMarkupMap.remove(&element);
     343    else
     344        m_elementToCSSAnimationsCreatedByMarkupMap.set(&element, WTFMove(newAnimations));
     345
    342346    keyframeEffectStack.setCSSAnimationList(currentAnimationList);
    343347}
Note: See TracChangeset for help on using the changeset viewer.