OLD | NEW |
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, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2008 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2008 Cameron McCormack <cam@mcc.id.au> |
7 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 else | 133 else |
134 animatedNumber = number; | 134 animatedNumber = number; |
135 } | 135 } |
136 | 136 |
137 protected: | 137 protected: |
138 SVGAnimationElement(const QualifiedName&, Document&); | 138 SVGAnimationElement(const QualifiedName&, Document&); |
139 | 139 |
140 void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value); | 140 void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value); |
141 void determinePropertyValueTypes(const String& from, const String& to); | 141 void determinePropertyValueTypes(const String& from, const String& to); |
142 | 142 |
143 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 143 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
144 virtual void svgAttributeChanged(const QualifiedName&) override; | 144 void svgAttributeChanged(const QualifiedName&) override; |
145 | 145 |
146 enum AttributeType { | 146 enum AttributeType { |
147 AttributeTypeCSS, | 147 AttributeTypeCSS, |
148 AttributeTypeXML, | 148 AttributeTypeXML, |
149 AttributeTypeAuto | 149 AttributeTypeAuto |
150 }; | 150 }; |
151 AttributeType attributeType() const { return m_attributeType; } | 151 AttributeType attributeType() const { return m_attributeType; } |
152 | 152 |
153 String toValue() const; | 153 String toValue() const; |
154 String byValue() const; | 154 String byValue() const; |
155 String fromValue() const; | 155 String fromValue() const; |
156 | 156 |
157 // from SVGSMILElement | 157 // from SVGSMILElement |
158 virtual void startedActiveInterval() override; | 158 void startedActiveInterval() override; |
159 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement*
resultElement) override; | 159 void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultE
lement) override; |
160 | 160 |
161 AnimatedPropertyValueType m_fromPropertyValueType; | 161 AnimatedPropertyValueType m_fromPropertyValueType; |
162 AnimatedPropertyValueType m_toPropertyValueType; | 162 AnimatedPropertyValueType m_toPropertyValueType; |
163 | 163 |
164 virtual void setTargetElement(SVGElement*) override; | 164 void setTargetElement(SVGElement*) override; |
165 virtual void setAttributeName(const QualifiedName&) override; | 165 void setAttributeName(const QualifiedName&) override; |
166 | 166 |
167 bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeTyp
e; } | 167 bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeTyp
e; } |
168 | 168 |
169 virtual void updateAnimationMode(); | 169 virtual void updateAnimationMode(); |
170 void setAnimationMode(AnimationMode animationMode) { m_animationMode = anima
tionMode; } | 170 void setAnimationMode(AnimationMode animationMode) { m_animationMode = anima
tionMode; } |
171 void setCalcMode(CalcMode calcMode) { m_calcMode = calcMode; } | 171 void setCalcMode(CalcMode calcMode) { m_calcMode = calcMode; } |
172 | 172 |
173 // Parses a list of values as specified by SVG, stripping leading | 173 // Parses a list of values as specified by SVG, stripping leading |
174 // and trailing whitespace, and places them in result. If the | 174 // and trailing whitespace, and places them in result. If the |
175 // format of the string is not valid, parseValues empties result | 175 // format of the string is not valid, parseValues empties result |
176 // and returns false. See | 176 // and returns false. See |
177 // http://www.w3.org/TR/SVG/animate.html#ValuesAttribute . | 177 // http://www.w3.org/TR/SVG/animate.html#ValuesAttribute . |
178 static bool parseValues(const String&, Vector<String>& result); | 178 static bool parseValues(const String&, Vector<String>& result); |
179 | 179 |
180 private: | 180 private: |
181 virtual bool isValid() const override final { return SVGTests::isValid(docum
ent()); } | 181 bool isValid() const final { return SVGTests::isValid(document()); } |
182 | 182 |
183 virtual void animationAttributeChanged() override; | 183 void animationAttributeChanged() override; |
184 void setAttributeType(const AtomicString&); | 184 void setAttributeType(const AtomicString&); |
185 | 185 |
186 void checkInvalidCSSAttributeType(); | 186 void checkInvalidCSSAttributeType(); |
187 | 187 |
188 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDuration
String) = 0; | 188 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDuration
String) = 0; |
189 virtual bool calculateFromAndToValues(const String& fromString, const String
& toString) = 0; | 189 virtual bool calculateFromAndToValues(const String& fromString, const String
& toString) = 0; |
190 virtual bool calculateFromAndByValues(const String& fromString, const String
& byString) = 0; | 190 virtual bool calculateFromAndByValues(const String& fromString, const String
& byString) = 0; |
191 virtual void calculateAnimatedValue(float percent, unsigned repeatCount, SVG
SMILElement* resultElement) = 0; | 191 virtual void calculateAnimatedValue(float percent, unsigned repeatCount, SVG
SMILElement* resultElement) = 0; |
192 virtual float calculateDistance(const String& /*fromString*/, const String&
/*toString*/) { return -1.f; } | 192 virtual float calculateDistance(const String& /*fromString*/, const String&
/*toString*/) { return -1.f; } |
193 | 193 |
(...skipping 22 matching lines...) Expand all Loading... |
216 String m_lastValuesAnimationFrom; | 216 String m_lastValuesAnimationFrom; |
217 String m_lastValuesAnimationTo; | 217 String m_lastValuesAnimationTo; |
218 bool m_hasInvalidCSSAttributeType; | 218 bool m_hasInvalidCSSAttributeType; |
219 CalcMode m_calcMode; | 219 CalcMode m_calcMode; |
220 AnimationMode m_animationMode; | 220 AnimationMode m_animationMode; |
221 }; | 221 }; |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
224 | 224 |
225 #endif // SVGAnimationElement_h | 225 #endif // SVGAnimationElement_h |
OLD | NEW |