Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1210)

Unified Diff: Source/core/svg/animation/SVGSMILElement.h

Issue 103393002: Use DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION to generate toSVGSMILElement() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/animation/SMILTimeContainer.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SVGSMILElement.h
diff --git a/Source/core/svg/animation/SVGSMILElement.h b/Source/core/svg/animation/SVGSMILElement.h
index 3ed75c5215c6be11380382b785cfe22ff5c77d2e..44c4fa19a4773af4b0fa2b409fd401bc85cbbe90 100644
--- a/Source/core/svg/animation/SVGSMILElement.h
+++ b/Source/core/svg/animation/SVGSMILElement.h
@@ -26,6 +26,7 @@
#ifndef SVGSMILElement_h
#define SVGSMILElement_h
+#include "SVGNames.h"
#include "core/svg/SVGElement.h"
#include "core/svg/animation/SMILTime.h"
#include "wtf/HashMap.h"
@@ -45,8 +46,6 @@ public:
SVGSMILElement(const QualifiedName&, Document&);
virtual ~SVGSMILElement();
- static bool isSMILElement(Node*);
-
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
@@ -239,12 +238,14 @@ private:
friend class ConditionEventListener;
};
-inline SVGSMILElement* toSVGSMILElement(Element* element)
+inline bool isSVGSMILElement(const Node& node)
{
- ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(element));
- return static_cast<SVGSMILElement*>(element);
+ return node.hasTagName(SVGNames::setTag) || node.hasTagName(SVGNames::animateTag) || node.hasTagName(SVGNames::animateMotionTag)
+ || node.hasTagName(SVGNames::animateTransformTag) || node.hasTagName(SVGNames::animateColorTag);
}
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement);
+
}
#endif // SVGSMILElement_h
« no previous file with comments | « Source/core/svg/animation/SMILTimeContainer.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698