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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateElement.h

Issue 2595393002: Fold SVGAnimatedTypeAnimator into SVGAnimateElement (Closed)
Patch Set: More ASSERT to DCHECK Created 3 years, 12 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 */ 21 */
22 22
23 #ifndef SVGAnimateElement_h 23 #ifndef SVGAnimateElement_h
24 #define SVGAnimateElement_h 24 #define SVGAnimateElement_h
25 25
26 #include "core/CSSPropertyNames.h"
26 #include "core/CoreExport.h" 27 #include "core/CoreExport.h"
27 #include "core/SVGNames.h" 28 #include "core/SVGNames.h"
28 #include "core/svg/SVGAnimatedTypeAnimator.h"
29 #include "core/svg/SVGAnimationElement.h" 29 #include "core/svg/SVGAnimationElement.h"
30 #include "platform/heap/Handle.h" 30 #include "platform/heap/Handle.h"
31 #include <base/gtest_prod_util.h> 31 #include <base/gtest_prod_util.h>
32 32
33 namespace blink { 33 namespace blink {
34 34
35 // If we have 'inherit' as animation value, we need to grab the value 35 // If we have 'inherit' as animation value, we need to grab the value
36 // during the animation since the value can be animated itself. 36 // during the animation since the value can be animated itself.
37 enum AnimatedPropertyValueType { RegularPropertyValue, InheritValue }; 37 enum AnimatedPropertyValueType { RegularPropertyValue, InheritValue };
38 38
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void setAttributeType(const AtomicString&); 94 void setAttributeType(const AtomicString&);
95 95
96 void checkInvalidCSSAttributeType(); 96 void checkInvalidCSSAttributeType();
97 bool hasInvalidCSSAttributeType() const { 97 bool hasInvalidCSSAttributeType() const {
98 return m_hasInvalidCSSAttributeType; 98 return m_hasInvalidCSSAttributeType;
99 } 99 }
100 bool hasValidTarget() final; 100 bool hasValidTarget() final;
101 bool hasValidAttributeName() const; 101 bool hasValidAttributeName() const;
102 virtual bool hasValidAttributeType(); 102 virtual bool hasValidAttributeType();
103 103
104 virtual void resolveTargetProperty();
105 void clearTargetProperty();
106
107 virtual SVGPropertyBase* createPropertyForAnimation(const String&) const;
108 SVGPropertyBase* createPropertyForAttributeAnimation(const String&) const;
109 SVGPropertyBase* createPropertyForCSSAnimation(const String&) const;
110
104 SVGPropertyBase* adjustForInheritance(SVGPropertyBase*, 111 SVGPropertyBase* adjustForInheritance(SVGPropertyBase*,
105 AnimatedPropertyValueType) const; 112 AnimatedPropertyValueType) const;
106 113
107 Member<SVGPropertyBase> m_fromProperty; 114 Member<SVGPropertyBase> m_fromProperty;
108 Member<SVGPropertyBase> m_toProperty; 115 Member<SVGPropertyBase> m_toProperty;
109 Member<SVGPropertyBase> m_toAtEndOfDurationProperty; 116 Member<SVGPropertyBase> m_toAtEndOfDurationProperty;
110 Member<SVGPropertyBase> m_animatedProperty; 117 Member<SVGPropertyBase> m_animatedValue;
111 118
112 SVGAnimatedTypeAnimator m_animator; 119 protected:
120 Member<SVGAnimatedPropertyBase> m_targetProperty;
121 AnimatedPropertyType m_type;
122 CSSPropertyID m_cssPropertyId;
113 123
124 bool isAnimatingSVGDom() const { return m_targetProperty; }
125 bool isAnimatingCSSProperty() const {
126 return m_cssPropertyId != CSSPropertyInvalid;
127 }
128
129 private:
114 AnimatedPropertyValueType m_fromPropertyValueType; 130 AnimatedPropertyValueType m_fromPropertyValueType;
115 AnimatedPropertyValueType m_toPropertyValueType; 131 AnimatedPropertyValueType m_toPropertyValueType;
116 AttributeType m_attributeType; 132 AttributeType m_attributeType;
117 bool m_hasInvalidCSSAttributeType; 133 bool m_hasInvalidCSSAttributeType;
118 }; 134 };
119 135
120 inline bool isSVGAnimateElement(const SVGElement& element) { 136 inline bool isSVGAnimateElement(const SVGElement& element) {
121 return element.hasTagName(SVGNames::animateTag) || 137 return element.hasTagName(SVGNames::animateTag) ||
122 element.hasTagName(SVGNames::animateTransformTag) || 138 element.hasTagName(SVGNames::animateTransformTag) ||
123 element.hasTagName(SVGNames::setTag); 139 element.hasTagName(SVGNames::setTag);
124 } 140 }
125 141
126 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement); 142 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement);
127 143
128 } // namespace blink 144 } // namespace blink
129 145
130 #endif // SVGAnimateElement_h 146 #endif // SVGAnimateElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/BUILD.gn ('k') | third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698