#ifndef SVGAnimateElement_h
#define SVGAnimateElement_h
-#include "SVGNames.h"
+#include "core/SVGNames.h"
+#include "core/svg/SVGAnimatedTypeAnimator.h"
#include "core/svg/SVGAnimationElement.h"
#include "wtf/OwnPtr.h"
-namespace WebCore {
+namespace blink {
-class SVGAnimatedProperty;
-class SVGAnimatedType;
class SVGAnimatedTypeAnimator;
class SVGAnimateElement : public SVGAnimationElement {
+ DEFINE_WRAPPERTYPEINFO();
public:
- static PassRefPtr<SVGAnimateElement> create(const QualifiedName&, Document&);
+ static PassRefPtrWillBeRawPtr<SVGAnimateElement> create(Document&);
virtual ~SVGAnimateElement();
- AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
+ virtual void trace(Visitor*) override;
+
+ AnimatedPropertyType animatedPropertyType();
+ bool animatedPropertyTypeSupportsAddition();
protected:
SVGAnimateElement(const QualifiedName&, Document&);
- virtual void resetAnimatedType();
- virtual void clearAnimatedType(SVGElement* targetElement);
-
- virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString);
- virtual bool calculateFromAndToValues(const String& fromString, const String& toString);
- virtual bool calculateFromAndByValues(const String& fromString, const String& byString);
- virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement);
- virtual void applyResultsToTarget();
- virtual float calculateDistance(const String& fromString, const String& toString);
- virtual bool isAdditive() const OVERRIDE;
+ virtual void resetAnimatedType() override final;
+ virtual void clearAnimatedType(SVGElement* targetElement) override final;
- virtual void setTargetElement(SVGElement*) OVERRIDE;
- virtual void setAttributeName(const QualifiedName&) OVERRIDE;
+ virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override final;
+ virtual bool calculateFromAndToValues(const String& fromString, const String& toString) override final;
+ virtual bool calculateFromAndByValues(const String& fromString, const String& byString) override final;
+ virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) override final;
+ virtual void applyResultsToTarget() override final;
+ virtual float calculateDistance(const String& fromString, const String& toString) override final;
+ virtual bool isAdditive() override final;
- AnimatedPropertyType m_animatedPropertyType;
+ virtual void setTargetElement(SVGElement*) override final;
+ virtual void setAttributeName(const QualifiedName&) override final;
private:
void resetAnimatedPropertyType();
SVGAnimatedTypeAnimator* ensureAnimator();
- bool animatedPropertyTypeSupportsAddition() const;
- virtual bool hasValidAttributeType();
+ virtual bool hasValidAttributeType() override;
- OwnPtr<SVGAnimatedType> m_fromType;
- OwnPtr<SVGAnimatedType> m_toType;
- OwnPtr<SVGAnimatedType> m_toAtEndOfDurationType;
- OwnPtr<SVGAnimatedType> m_animatedType;
+ RefPtr<SVGPropertyBase> m_fromProperty;
+ RefPtr<SVGPropertyBase> m_toProperty;
+ RefPtr<SVGPropertyBase> m_toAtEndOfDurationProperty;
+ RefPtr<SVGPropertyBase> m_animatedProperty;
- SVGElementAnimatedPropertyList m_animatedProperties;
- OwnPtr<SVGAnimatedTypeAnimator> m_animator;
+ OwnPtrWillBeMember<SVGAnimatedTypeAnimator> m_animator;
};
-inline SVGAnimateElement* toSVGAnimateElement(Element* element)
+inline bool isSVGAnimateElement(const SVGElement& element)
{
- ASSERT_WITH_SECURITY_IMPLICATION(!element
- || element->hasTagName(SVGNames::animateTag)
- || element->hasTagName(SVGNames::animateColorTag)
- || element->hasTagName(SVGNames::animateTransformTag)
- || element->hasTagName(SVGNames::setTag));
- return static_cast<SVGAnimateElement*>(element);
+ return element.hasTagName(SVGNames::animateTag)
+ || element.hasTagName(SVGNames::animateTransformTag)
+ || element.hasTagName(SVGNames::setTag);
}
-} // namespace WebCore
+DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement);
+
+} // namespace blink
#endif // SVGAnimateElement_h