ImplicitAnimation.h [plain text]
#pragma once
#include "AnimationBase.h"
#include "CSSPropertyNames.h"
#include "Document.h"
namespace WebCore {
class RenderElement;
class ImplicitAnimation : public AnimationBase {
public:
static Ref<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, Element& element, CompositeAnimation& compositeAnimation, const RenderStyle& fromStyle)
{
return adoptRef(*new ImplicitAnimation(animation, animatingProperty, element, compositeAnimation, fromStyle));
};
CSSPropertyID transitionProperty() const { return m_transitionProperty; }
CSSPropertyID animatingProperty() const { return m_animatingProperty; }
void onAnimationEnd(double elapsedTime) override;
bool startAnimation(double timeOffset) override;
void pauseAnimation(double timeOffset) override;
void endAnimation(bool fillingForwards = false) override;
bool animate(CompositeAnimation&, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle);
void getAnimatedStyle(std::unique_ptr<RenderStyle>& animatedStyle) override;
void reset(const RenderStyle& to, CompositeAnimation&);
bool computeExtentOfTransformAnimation(LayoutRect&) const override;
void setOverridden(bool);
bool overridden() const override { return m_overridden; }
bool affectsProperty(CSSPropertyID) const override;
bool hasStyle() const { return m_fromStyle && m_toStyle; }
bool isTargetPropertyEqual(CSSPropertyID, const RenderStyle*);
void blendPropertyValueInStyle(CSSPropertyID, RenderStyle*);
Optional<Seconds> timeToNextService() override;
bool active() const { return m_active; }
void setActive(bool b) { m_active = b; }
const RenderStyle& unanimatedStyle() const override { return *m_fromStyle; }
protected:
bool shouldSendEventForListener(Document::ListenerType) const;
bool sendTransitionEvent(const AtomicString&, double elapsedTime);
void validateTransformFunctionList();
void checkForMatchingFilterFunctionLists();
#if ENABLE(FILTERS_LEVEL_2)
void checkForMatchingBackdropFilterFunctionLists();
#endif
void checkForMatchingColorFilterFunctionLists();
private:
ImplicitAnimation(const Animation&, CSSPropertyID, Element&, CompositeAnimation&, const RenderStyle&);
virtual ~ImplicitAnimation();
std::unique_ptr<RenderStyle> m_fromStyle;
std::unique_ptr<RenderStyle> m_toStyle;
CSSPropertyID m_transitionProperty; CSSPropertyID m_animatingProperty;
bool m_active { true }; bool m_overridden { false }; };
}