Changeset 252253 in webkit


Ignore:
Timestamp:
Nov 8, 2019 12:40:57 PM (4 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Use a keyframe effect stack to resolve animations on an element
https://bugs.webkit.org/show_bug.cgi?id=204010

Reviewed by Dean Jackson.

Until now, when resolving animations for an element, we would call animationsForElement() during each resolution which
means doing several hash table lookups to locate the various classes of animations for that given element, sorting each
of those animations and inserting them into a new Vector.

We now use a KeyframeEffectStack which keeps a list of KeyframeEffect objects that apply to a given target, provided the
effect also has a valid animation and that animation has a valid timeline, all pre-conditions for that effect to produce
an animated value. Any time one of those pre-conditions change, we update the membership of that effect in the stack.
The KeyframeEffectStack is a new member of ElementRareData.

Now, each time we resolve an animation for an element, we iterate over the KeyframeEffect objects returned by calling
sortEffects() on the KeyframeEffectStack which will sort the stack's effects only if a new effect had been added since
the last iteration, which means that simple animations that are not mutated will require sorting of the stack just once,
and the addition of several animations in a single animation frame will require sorting just once as well.

It was also found while doing this work that Style::TreeResolver::createAnimatedElementUpdate would call RenderStyle::clonePtr()
for any element that was part of a document containing a timeline, regardless of whether that element had any animations. Now
we check whether that element's KeyframeEffectStack contains any effects prior to cloning the style.

No tests or changes to existed test expectations as this should not yield any change in behavior.

  • Sources.txt: Add the new KeyframeEffectStack.
  • WebCore.xcodeproj/project.pbxproj:
  • animation/AnimationEffect.h:

(WebCore::AnimationEffect::setAnimation):

  • animation/AnimationTimeline.cpp:

(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Since we need to know the order of CSS @keyframes rules listed in animation-name
when sorting effects, we must compile the ordered list of those @keyframe rules as we update CSS animations for an element and store it on its
KeyframeEffectStack.

  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::resolveAnimationsForElement): Deleted. Replaced by Element::applyKeyframeEffects().

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

(WebCore::KeyframeEffect::animationTimelineDidChange):
(WebCore::KeyframeEffect::setAnimation):
(WebCore::KeyframeEffect::setTarget):

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

(WebCore::KeyframeEffectStack::KeyframeEffectStack):
(WebCore::KeyframeEffectStack::~KeyframeEffectStack):
(WebCore::KeyframeEffectStack::addEffect):
(WebCore::KeyframeEffectStack::removeEffect):
(WebCore::KeyframeEffectStack::sortedEffects):
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
(WebCore::KeyframeEffectStack::setCSSAnimationNames):

  • animation/KeyframeEffectStack.h: Added.

(WebCore::KeyframeEffectStack::hasEffects const):

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::persist):

  • dom/Element.cpp:

(WebCore::Element::ensureKeyframeEffectStack):
(WebCore::Element::hasKeyframeEffects const):
(WebCore::Element::applyKeyframeEffects):

  • dom/Element.h:
  • dom/ElementRareData.cpp:
  • dom/ElementRareData.h:

(WebCore::ElementRareData::keyframeEffectStack):
(WebCore::ElementRareData::setKeyframeEffectStack):

  • style/StyleTreeResolver.cpp:

(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

Location:
trunk/Source/WebCore
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252245 r252253  
     12019-11-08  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Use a keyframe effect stack to resolve animations on an element
     4        https://bugs.webkit.org/show_bug.cgi?id=204010
     5
     6        Reviewed by Dean Jackson.
     7
     8        Until now, when resolving animations for an element, we would call animationsForElement() during each resolution which
     9        means doing several hash table lookups to locate the various classes of animations for that given element, sorting each
     10        of those animations and inserting them into a new Vector.
     11
     12        We now use a KeyframeEffectStack which keeps a list of KeyframeEffect objects that apply to a given target, provided the
     13        effect also has a valid animation and that animation has a valid timeline, all pre-conditions for that effect to produce
     14        an animated value. Any time one of those pre-conditions change, we update the membership of that effect in the stack.
     15        The KeyframeEffectStack is a new member of ElementRareData.
     16
     17        Now, each time we resolve an animation for an element, we iterate over the KeyframeEffect objects returned by calling
     18        sortEffects() on the KeyframeEffectStack which will sort the stack's effects only if a new effect had been added since
     19        the last iteration, which means that simple animations that are not mutated will require sorting of the stack just once,
     20        and the addition of several animations in a single animation frame will require sorting just once as well.
     21
     22        It was also found while doing this work that Style::TreeResolver::createAnimatedElementUpdate would call RenderStyle::clonePtr()
     23        for any element that was part of a document containing a timeline, regardless of whether that element had any animations. Now
     24        we check whether that element's KeyframeEffectStack contains any effects prior to cloning the style.
     25
     26        No tests or changes to existed test expectations as this should not yield any change in behavior.
     27
     28        * Sources.txt: Add the new KeyframeEffectStack.
     29        * WebCore.xcodeproj/project.pbxproj:
     30        * animation/AnimationEffect.h:
     31        (WebCore::AnimationEffect::setAnimation):
     32        * animation/AnimationTimeline.cpp:
     33        (WebCore::AnimationTimeline::removeAnimation):
     34        (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Since we need to know the order of CSS @keyframes rules listed in animation-name
     35        when sorting effects, we must compile the ordered list of those @keyframe rules as we update CSS animations for an element and store it on its
     36        KeyframeEffectStack.
     37        * animation/DocumentTimeline.cpp:
     38        (WebCore::DocumentTimeline::resolveAnimationsForElement): Deleted. Replaced by Element::applyKeyframeEffects().
     39        * animation/DocumentTimeline.h:
     40        * animation/KeyframeEffect.cpp:
     41        (WebCore::KeyframeEffect::animationTimelineDidChange):
     42        (WebCore::KeyframeEffect::setAnimation):
     43        (WebCore::KeyframeEffect::setTarget):
     44        * animation/KeyframeEffect.h:
     45        * animation/KeyframeEffectStack.cpp: Added.
     46        (WebCore::KeyframeEffectStack::KeyframeEffectStack):
     47        (WebCore::KeyframeEffectStack::~KeyframeEffectStack):
     48        (WebCore::KeyframeEffectStack::addEffect):
     49        (WebCore::KeyframeEffectStack::removeEffect):
     50        (WebCore::KeyframeEffectStack::sortedEffects):
     51        (WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
     52        (WebCore::KeyframeEffectStack::setCSSAnimationNames):
     53        * animation/KeyframeEffectStack.h: Added.
     54        (WebCore::KeyframeEffectStack::hasEffects const):
     55        * animation/WebAnimation.cpp:
     56        (WebCore::WebAnimation::setTimelineInternal):
     57        (WebCore::WebAnimation::persist):
     58        * dom/Element.cpp:
     59        (WebCore::Element::ensureKeyframeEffectStack):
     60        (WebCore::Element::hasKeyframeEffects const):
     61        (WebCore::Element::applyKeyframeEffects):
     62        * dom/Element.h:
     63        * dom/ElementRareData.cpp:
     64        * dom/ElementRareData.h:
     65        (WebCore::ElementRareData::keyframeEffectStack):
     66        (WebCore::ElementRareData::setKeyframeEffectStack):
     67        * style/StyleTreeResolver.cpp:
     68        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
     69
    1702019-11-07  Dean Jackson  <dino@apple.com>
    271
  • trunk/Source/WebCore/Sources.txt

    r252226 r252253  
    449449
    450450animation/AnimationEffect.cpp
     451animation/KeyframeEffectStack.cpp
    451452animation/AnimationPlaybackEvent.cpp
    452453animation/AnimationTimeline.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r252226 r252253  
    20932093                71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
    20942094                71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
     2095                71A58196236F467600D81A24 /* KeyframeEffectStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A58193236F466400D81A24 /* KeyframeEffectStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
    20952096                71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    20962097                71B5AB2621F1D9F400376E5C /* PointerCaptureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B5AB2421F1D9E200376E5C /* PointerCaptureController.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    94759476                71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
    94769477                71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
     9478                71A58193236F466400D81A24 /* KeyframeEffectStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyframeEffectStack.h; sourceTree = "<group>"; };
     9479                71A58195236F466500D81A24 /* KeyframeEffectStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyframeEffectStack.cpp; sourceTree = "<group>"; };
    94779480                71AEE4EB21B5A49C00DDB036 /* TouchAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchAction.h; sourceTree = "<group>"; };
    94789481                71B0460A1DD3C2EE00EE19CF /* status-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "status-support.js"; sourceTree = "<group>"; };
     
    2085520858                                71247E321FEA5F7F008C08CE /* KeyframeEffectOptions.h */,
    2085620859                                71247E301FEA5F7E008C08CE /* KeyframeEffectOptions.idl */,
     20860                                71A58195236F466500D81A24 /* KeyframeEffectStack.cpp */,
     20861                                71A58193236F466400D81A24 /* KeyframeEffectStack.h */,
    2085720862                                7120733D216DFAF100C78329 /* OptionalEffectTiming.h */,
    2085820863                                7120733F216DFAF200C78329 /* OptionalEffectTiming.idl */,
     
    3066930674                                FDF6BAF9134A4C9800822920 /* JSOfflineAudioCompletionEvent.h in Headers */,
    3067030675                                FDA9326716703BA9008982DC /* JSOfflineAudioContext.h in Headers */,
    30671                                 E45BA6AA2374926C004DFC07 /* MatchedDeclarationsCache.h in Headers */,
    3067230676                                314877E61FAAB02500C05759 /* JSOffscreenCanvas.h in Headers */,
    3067330677                                3140C5271FDF558200D2A873 /* JSOffscreenCanvasRenderingContext2D.h in Headers */,
     
    3108331087                                71556CB41F9F09BA00E78D08 /* KeyframeEffect.h in Headers */,
    3108431088                                71247E3A1FEA5F86008C08CE /* KeyframeEffectOptions.h in Headers */,
     31089                                71A58196236F467600D81A24 /* KeyframeEffectStack.h in Headers */,
    3108531090                                BC5EBA110E823E4700B25965 /* KeyframeList.h in Headers */,
    3108631091                                E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */,
     
    3117431179                                9728C3141268E4390041E89B /* MarkupAccumulator.h in Headers */,
    3117531180                                00C60E3F13D76D7E0092A275 /* MarkupTokenizerInlines.h in Headers */,
     31181                                E45BA6AA2374926C004DFC07 /* MatchedDeclarationsCache.h in Headers */,
    3117631182                                FABE72F51059C1EB00D888CC /* MathMLAnnotationElement.h in Headers */,
    3117731183                                FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */,
  • trunk/Source/WebCore/animation/AnimationEffect.h

    r251785 r252253  
    4848namespace WebCore {
    4949
    50 class AnimationEffect : public RefCounted<AnimationEffect> {
     50class AnimationEffect : public RefCounted<AnimationEffect>, public CanMakeWeakPtr<AnimationEffect> {
    5151public:
    5252    virtual ~AnimationEffect();
     
    6363    virtual void animationDidSeek() = 0;
    6464    virtual void animationSuspensionStateDidChange(bool) = 0;
     65    virtual void animationTimelineDidChange(AnimationTimeline*) = 0;
    6566
    6667    WebAnimation* animation() const { return m_animation.get(); }
    67     void setAnimation(WebAnimation* animation) { m_animation = makeWeakPtr(animation); }
     68    virtual void setAnimation(WebAnimation* animation) { m_animation = makeWeakPtr(animation); }
    6869
    6970    Seconds delay() const { return m_delay; }
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r251543 r252253  
    3737#include "Element.h"
    3838#include "KeyframeEffect.h"
     39#include "KeyframeEffectStack.h"
    3940#include "RenderStyle.h"
    4041#include "RenderView.h"
     
    7677    m_animations.remove(&animation);
    7778    if (is<KeyframeEffect>(animation.effect())) {
    78         if (auto* target = downcast<KeyframeEffect>(animation.effect())->target())
     79        if (auto* target = downcast<KeyframeEffect>(animation.effect())->target()) {
    7980            animationWasRemovedFromElement(animation, *target);
     81            target->ensureKeyframeEffectStack().removeEffect(*downcast<KeyframeEffect>(animation.effect()));
     82        }
    8083    }
    8184}
     
    244247void AnimationTimeline::updateCSSAnimationsForElement(Element& element, const RenderStyle* currentStyle, const RenderStyle& afterChangeStyle)
    245248{
     249    Vector<String> animationNames;
     250
    246251    // In case this element is newly getting a "display: none" we need to cancel all of its animations and disregard new ones.
    247252    if (currentStyle && currentStyle->hasAnimations() && currentStyle->display() != DisplayType::None && afterChangeStyle.display() == DisplayType::None) {
     
    250255                cancelDeclarativeAnimation(*cssAnimationsByNameMapItem.value);
    251256        }
     257        element.ensureKeyframeEffectStack().setCSSAnimationNames(WTFMove(animationNames));
    252258        return;
    253259    }
     
    276282            auto& currentAnimation = currentAnimations->animation(i);
    277283            auto& name = currentAnimation.name();
     284            animationNames.append(name);
    278285            if (namesOfPreviousAnimations.contains(name)) {
    279286                // We've found the name of this animation in our list of previous animations, this means we've already
     
    297304            cancelDeclarativeAnimation(*animation);
    298305    }
     306
     307    element.ensureKeyframeEffectStack().setCSSAnimationNames(WTFMove(animationNames));
    299308}
    300309
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r250839 r252253  
    2929#include "AnimationPlaybackEvent.h"
    3030#include "CSSAnimation.h"
    31 #include "CSSPropertyAnimation.h"
    3231#include "CSSTransition.h"
    3332#include "DOMWindow.h"
     
    674673}
    675674
    676 bool DocumentTimeline::resolveAnimationsForElement(Element& element, RenderStyle& targetStyle)
    677 {
    678     bool hasNonAcceleratedAnimationProperty = false;
    679 
    680     for (const auto& animation : animationsForElement(element)) {
    681         animation->resolve(targetStyle);
    682 
    683         if (hasNonAcceleratedAnimationProperty)
    684             continue;
    685 
    686         auto* effect = animation->effect();
    687         if (!effect || !is<KeyframeEffect>(effect))
    688             continue;
    689 
    690         auto* keyframeEffect = downcast<KeyframeEffect>(effect);
    691         for (auto cssPropertyId : keyframeEffect->animatedProperties()) {
    692             if (!CSSPropertyAnimation::animationOfPropertyIsAccelerated(cssPropertyId)) {
    693                 hasNonAcceleratedAnimationProperty = true;
    694                 break;
    695             }
    696         }
    697     }
    698 
    699     return !hasNonAcceleratedAnimationProperty;
    700 }
    701 
    702675bool DocumentTimeline::runningAnimationsForElementAreAllAccelerated(Element& element) const
    703676{
  • trunk/Source/WebCore/animation/DocumentTimeline.h

    r250617 r252253  
    6868    void applyPendingAcceleratedAnimations();
    6969    bool runningAnimationsForElementAreAllAccelerated(Element&) const;
    70     bool resolveAnimationsForElement(Element&, RenderStyle&);
    7170    void detachFromDocument();
    7271
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r251959 r252253  
    4545#include "JSDOMConvert.h"
    4646#include "JSKeyframeEffect.h"
     47#include "KeyframeEffectStack.h"
    4748#include "RenderBox.h"
    4849#include "RenderBoxModelObject.h"
     
    991992}
    992993
     994void KeyframeEffect::animationTimelineDidChange(AnimationTimeline* timeline)
     995{
     996    if (!m_target)
     997        return;
     998
     999    if (timeline)
     1000        m_target->ensureKeyframeEffectStack().addEffect(*this);
     1001    else
     1002        m_target->ensureKeyframeEffectStack().removeEffect(*this);
     1003}
     1004
     1005void KeyframeEffect::setAnimation(WebAnimation* animation)
     1006{
     1007    bool animationChanged = animation != this->animation();
     1008    AnimationEffect::setAnimation(animation);
     1009    if (m_target && animationChanged) {
     1010        if (animation)
     1011            m_target->ensureKeyframeEffectStack().addEffect(*this);
     1012        else
     1013            m_target->ensureKeyframeEffectStack().removeEffect(*this);
     1014    }
     1015}
     1016
    9931017void KeyframeEffect::setTarget(RefPtr<Element>&& newTarget)
    9941018{
     
    10101034    // any animated styles are removed immediately.
    10111035    invalidateElement(previousTarget.get());
     1036
     1037    if (previousTarget)
     1038        previousTarget->ensureKeyframeEffectStack().removeEffect(*this);
     1039    if (m_target)
     1040        m_target->ensureKeyframeEffectStack().addEffect(*this);
    10121041}
    10131042
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r251706 r252253  
    115115    void animationDidSeek() final;
    116116    void animationSuspensionStateDidChange(bool) final;
     117    void animationTimelineDidChange(AnimationTimeline*) final;
    117118    void applyPendingAcceleratedActions();
    118119    bool isRunningAccelerated() const { return m_lastRecordedAcceleratedAction != AcceleratedAction::Stop; }
    119120    bool hasPendingAcceleratedAction() const { return !m_pendingAcceleratedActions.isEmpty() && isRunningAccelerated(); }
     121
     122    void setAnimation(WebAnimation*) final;
    120123
    121124    RenderElement* renderer() const override;
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r252007 r252253  
    238238
    239239    m_timeline = WTFMove(timeline);
     240
     241    if (m_effect)
     242        m_effect->animationTimelineDidChange(m_timeline.get());
    240243}
    241244
     
    12591262
    12601263    if (previousReplaceState == ReplaceState::Removed && m_timeline) {
    1261         if (is<KeyframeEffect>(m_effect))
    1262             m_timeline->animationWasAddedToElement(*this, *downcast<KeyframeEffect>(m_effect.get())->target());
     1264        if (is<KeyframeEffect>(m_effect)) {
     1265            auto& keyframeEffect = downcast<KeyframeEffect>(*m_effect);
     1266            auto& target = *keyframeEffect.target();
     1267            m_timeline->animationWasAddedToElement(*this, target);
     1268            target.ensureKeyframeEffectStack().addEffect(keyframeEffect);
     1269        }
    12631270    }
    12641271}
  • trunk/Source/WebCore/dom/Element.cpp

    r251425 r252253  
    3232#include "CSSAnimationController.h"
    3333#include "CSSParser.h"
     34#include "CSSPropertyAnimation.h"
    3435#include "Chrome.h"
    3536#include "ChromeClient.h"
     
    36783679#endif
    36793680
     3681KeyframeEffectStack& Element::ensureKeyframeEffectStack()
     3682{
     3683    auto& rareData = ensureElementRareData();
     3684    if (!rareData.keyframeEffectStack())
     3685        rareData.setKeyframeEffectStack(makeUnique<KeyframeEffectStack>());
     3686    return *rareData.keyframeEffectStack();
     3687}
     3688
     3689bool Element::hasKeyframeEffects() const
     3690{
     3691    if (!hasRareData())
     3692        return false;
     3693
     3694    auto* keyframeEffectStack = elementRareData()->keyframeEffectStack();
     3695    return keyframeEffectStack && keyframeEffectStack->hasEffects();
     3696}
     3697
     3698bool Element::applyKeyframeEffects(RenderStyle& targetStyle)
     3699{
     3700    bool hasNonAcceleratedAnimationProperty = false;
     3701
     3702    for (const auto& effect : ensureKeyframeEffectStack().sortedEffects()) {
     3703        ASSERT(effect->animation());
     3704        effect->animation()->resolve(targetStyle);
     3705
     3706        if (hasNonAcceleratedAnimationProperty)
     3707            continue;
     3708
     3709        // FIXME: https://bugs.webkit.org/show_bug.cgi?id=204009
     3710        // KeyframeEffectStack and KeyframeEffect should indicate whether it only contains accelerated animation properties
     3711        for (auto cssPropertyId : effect->animatedProperties()) {
     3712            if (!CSSPropertyAnimation::animationOfPropertyIsAccelerated(cssPropertyId)) {
     3713                hasNonAcceleratedAnimationProperty = true;
     3714                break;
     3715            }
     3716        }
     3717    }
     3718
     3719    return !hasNonAcceleratedAnimationProperty;
     3720}
     3721
    36803722#if ENABLE(RESIZE_OBSERVER)
    36813723void Element::disconnectFromResizeObservers()
  • trunk/Source/WebCore/dom/Element.h

    r251425 r252253  
    4848class IntSize;
    4949class JSCustomElementInterface;
     50class KeyframeEffectStack;
    5051class KeyboardEvent;
    5152class Locale;
     
    490491    void clearHasCSSAnimation();
    491492
     493    KeyframeEffectStack& ensureKeyframeEffectStack();
     494    bool hasKeyframeEffects() const;
     495    bool applyKeyframeEffects(RenderStyle&);
     496
    492497#if ENABLE(FULLSCREEN_API)
    493498    WEBCORE_EXPORT bool containsFullScreenElement() const;
  • trunk/Source/WebCore/dom/ElementRareData.cpp

    r250584 r252253  
    4444    LayoutSize sizeForResizing;
    4545    IntPoint savedLayerScrollPosition;
    46     void* pointers[10];
     46    void* pointers[11];
    4747#if ENABLE(INTERSECTION_OBSERVER)
    4848    void* intersectionObserverData;
  • trunk/Source/WebCore/dom/ElementRareData.h

    r250584 r252253  
    2626#include "DatasetDOMStringMap.h"
    2727#include "IntersectionObserver.h"
     28#include "KeyframeEffectStack.h"
    2829#include "NamedNodeMap.h"
    2930#include "NodeRareData.h"
     
    100101    bool hasCSSAnimation() const { return m_hasCSSAnimation; }
    101102    void setHasCSSAnimation(bool value) { m_hasCSSAnimation = value; }
     103
     104    KeyframeEffectStack* keyframeEffectStack() { return m_keyframeEffectStack.get(); }
     105    void setKeyframeEffectStack(std::unique_ptr<KeyframeEffectStack>&& keyframeEffectStack) { m_keyframeEffectStack = WTFMove(keyframeEffectStack); }
    102106
    103107    bool hasElementIdentifier() const { return m_hasElementIdentifier; }
     
    187191#endif
    188192
     193    std::unique_ptr<KeyframeEffectStack> m_keyframeEffectStack;
     194
    189195    RefPtr<PseudoElement> m_beforePseudoElement;
    190196    RefPtr<PseudoElement> m_afterPseudoElement;
  • trunk/Source/WebCore/style/StyleTreeResolver.cpp

    r252208 r252253  
    318318    }
    319319
    320     if (auto timeline = m_document.existingTimeline()) {
    321         // Now we can update all Web animations, which will include CSS Animations as well
    322         // as animations created via the JS API.
     320    // Now we can update all Web animations, which will include CSS Animations as well
     321    // as animations created via the JS API.
     322    if (element.hasKeyframeEffects()) {
    323323        auto animatedStyle = RenderStyle::clonePtr(*newStyle);
    324         shouldRecompositeLayer = timeline->resolveAnimationsForElement(element, *animatedStyle);
     324        shouldRecompositeLayer = element.applyKeyframeEffects(*animatedStyle);
    325325        newStyle = WTFMove(animatedStyle);
    326326    }
Note: See TracChangeset for help on using the changeset viewer.