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, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* fromStyle)
{
return adoptRef(*new ImplicitAnimation(animation, animatingProperty, renderer, 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() override;
bool animate(CompositeAnimation&, RenderElement*, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle) override;
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*);
std::optional<Seconds> timeToNextService() override;
bool active() const { return m_active; }
void setActive(bool b) { m_active = b; }
protected:
bool shouldSendEventForListener(Document::ListenerType) const;
bool sendTransitionEvent(const AtomicString&, double elapsedTime);
void validateTransformFunctionList();
void checkForMatchingFilterFunctionLists();
#if ENABLE(FILTERS_LEVEL_2)
void checkForMatchingBackdropFilterFunctionLists();
#endif
private:
ImplicitAnimation(const Animation&, CSSPropertyID, RenderElement*, 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 }; };
}