<https://webkit.org/b/119996> Introduce toSVGAnimateElement(), and use it
[WebKit-https.git] / Source / WebCore / svg / SVGAnimateElement.h
index d748fcc..5070d92 100644 (file)
@@ -27,6 +27,7 @@
 #include "SVGAnimatedType.h"
 #include "SVGAnimatedTypeAnimator.h"
 #include "SVGAnimationElement.h"
+#include "SVGNames.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
@@ -75,6 +76,16 @@ private:
     OwnPtr<SVGAnimatedTypeAnimator> m_animator;
 };
 
+inline SVGAnimateElement* toSVGAnimateElement(Element* 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);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)