Chromium Code Reviews| 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 |