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

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..b1a8547778e61401487d690a2488b06a9f84d629 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,20 @@ private:
friend class ConditionEventListener;
};
-inline SVGSMILElement* toSVGSMILElement(Element* element)
+inline bool isSVGSMILElement(Node* node)
tkent 2013/12/04 01:55:16 Having both of a pointer version and a reference v
{
- ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(element));
- return static_cast<SVGSMILElement*>(element);
+ return node && (node->hasTagName(SVGNames::setTag) || node->hasTagName(SVGNames::animateTag) || node->hasTagName(SVGNames::animateMotionTag)
+ || node->hasTagName(SVGNames::animateTransformTag) || node->hasTagName(SVGNames::animateColorTag));
}
+inline bool isSVGSMILElement(const Node& node)
+{
+ 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