#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
-namespace WebCore {
+namespace blink {
class CSSAnimations;
class RenderObject;
class Element;
+using AnimationPlayerCountedSet = WillBeHeapHashCountedSet<RawPtrWillBeWeakMember<AnimationPlayer>>;
+
class ActiveAnimations : public NoBaseWillBeGarbageCollectedFinalized<ActiveAnimations> {
WTF_MAKE_NONCOPYABLE(ActiveAnimations);
public:
- ActiveAnimations()
- : m_animationStyleChange(false)
- {
- }
-
+ ActiveAnimations();
~ActiveAnimations();
// Animations that are currently active for this element, their effects will be applied
// during a style recalc. CSS Transitions are included in this stack.
AnimationStack& defaultStack() { return m_defaultStack; }
+ const AnimationStack& defaultStack() const { return m_defaultStack; }
// Tracks the state of active CSS Animations and Transitions. The individual animations
// will also be part of the default stack, but the mapping betwen animation name and
// player is kept here.
CSSAnimations& cssAnimations() { return m_cssAnimations; }
const CSSAnimations& cssAnimations() const { return m_cssAnimations; }
- typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<AnimationPlayer>, int> AnimationPlayerCountedSet;
// AnimationPlayers which have animations targeting this element.
- const AnimationPlayerCountedSet& players() const { return m_players; }
- void addPlayer(AnimationPlayer*);
- void removePlayer(AnimationPlayer*);
-
-#if ENABLE(OILPAN)
- bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.isEmpty(); }
-#else
- bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.isEmpty() && m_animations.isEmpty(); }
-#endif
+ AnimationPlayerCountedSet& players() { return m_players; }
+
+ bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.isEmpty() && m_players.isEmpty(); }
void cancelAnimationOnCompositor();
void updateAnimationFlags(RenderStyle&);
void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleChange = animationStyleChange; }
+ const RenderStyle* baseRenderStyle() const;
+ void updateBaseRenderStyle(const RenderStyle*);
+ void clearBaseRenderStyle();
+
#if !ENABLE(OILPAN)
void addAnimation(Animation* animation) { m_animations.append(animation); }
void notifyAnimationDestroyed(Animation* animation) { m_animations.remove(m_animations.find(animation)); }
CSSAnimations m_cssAnimations;
AnimationPlayerCountedSet m_players;
bool m_animationStyleChange;
+ RefPtr<RenderStyle> m_baseRenderStyle;
#if !ENABLE(OILPAN)
// FIXME: Oilpan: This is to avoid a reference cycle that keeps Elements alive
friend class CSSAnimations;
};
-} // namespace WebCore
+} // namespace blink
#endif