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

Side by Side Diff: Source/WebCore/svg/SVGAnimationElement.h

Issue 11184044: Merge 130777 - Prevent animation when CSS attributeType is invalid. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « Source/WebCore/svg/SVGAnimateElement.cpp ('k') | Source/WebCore/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 bool isSupportedAttribute(const QualifiedName&); 177 bool isSupportedAttribute(const QualifiedName&);
178 virtual void parseAttribute(const Attribute&) OVERRIDE; 178 virtual void parseAttribute(const Attribute&) OVERRIDE;
179 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; 179 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
180 180
181 enum AttributeType { 181 enum AttributeType {
182 AttributeTypeCSS, 182 AttributeTypeCSS,
183 AttributeTypeXML, 183 AttributeTypeXML,
184 AttributeTypeAuto 184 AttributeTypeAuto
185 }; 185 };
186 AttributeType attributeType() const; 186 AttributeType attributeType() const { return m_attributeType; }
187 187
188 String toValue() const; 188 String toValue() const;
189 String byValue() const; 189 String byValue() const;
190 String fromValue() const; 190 String fromValue() const;
191 191
192 String targetAttributeBaseValue(); 192 String targetAttributeBaseValue();
193 193
194 // from SVGSMILElement 194 // from SVGSMILElement
195 virtual void startedActiveInterval() OVERRIDE; 195 virtual void startedActiveInterval() OVERRIDE;
196 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) OVERRIDE; 196 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) OVERRIDE;
197 197
198 AnimatedPropertyValueType m_fromPropertyValueType; 198 AnimatedPropertyValueType m_fromPropertyValueType;
199 AnimatedPropertyValueType m_toPropertyValueType; 199 AnimatedPropertyValueType m_toPropertyValueType;
200 200
201 virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* oldTarget) OVERRIDE;
202 bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeTyp e; }
203
201 private: 204 private:
202 virtual void animationAttributeChanged() OVERRIDE; 205 virtual void animationAttributeChanged() OVERRIDE;
206 virtual void setAttributeName(const QualifiedName&) OVERRIDE;
207 void setAttributeType(const AtomicString&);
208
209 void checkInvalidCSSAttributeType(SVGElement*);
203 210
204 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDuration String) = 0; 211 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDuration String) = 0;
205 virtual bool calculateFromAndToValues(const String& fromString, const String & toString) = 0; 212 virtual bool calculateFromAndToValues(const String& fromString, const String & toString) = 0;
206 virtual bool calculateFromAndByValues(const String& fromString, const String & byString) = 0; 213 virtual bool calculateFromAndByValues(const String& fromString, const String & byString) = 0;
207 virtual void calculateAnimatedValue(float percent, unsigned repeatCount, SVG SMILElement* resultElement) = 0; 214 virtual void calculateAnimatedValue(float percent, unsigned repeatCount, SVG SMILElement* resultElement) = 0;
208 virtual float calculateDistance(const String& /*fromString*/, const String& /*toString*/) { return -1.f; } 215 virtual float calculateDistance(const String& /*fromString*/, const String& /*toString*/) { return -1.f; }
209 virtual Path animationPath() const { return Path(); } 216 virtual Path animationPath() const { return Path(); }
210 217
211 void currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to); 218 void currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to);
212 void calculateKeyTimesForCalcModePaced(); 219 void calculateKeyTimesForCalcModePaced();
(...skipping 10 matching lines...) Expand all
223 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq uired) 230 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq uired)
224 END_DECLARE_ANIMATED_PROPERTIES 231 END_DECLARE_ANIMATED_PROPERTIES
225 232
226 // SVGTests 233 // SVGTests
227 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFe atures(this); } 234 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFe atures(this); }
228 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequired Extensions(this); } 235 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequired Extensions(this); }
229 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLangua ge(this); } 236 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLangua ge(this); }
230 237
231 bool m_animationValid; 238 bool m_animationValid;
232 239
240 AttributeType m_attributeType;
233 Vector<String> m_values; 241 Vector<String> m_values;
234 Vector<float> m_keyTimes; 242 Vector<float> m_keyTimes;
235 Vector<float> m_keyPoints; 243 Vector<float> m_keyPoints;
236 Vector<UnitBezier> m_keySplines; 244 Vector<UnitBezier> m_keySplines;
237 String m_lastValuesAnimationFrom; 245 String m_lastValuesAnimationFrom;
238 String m_lastValuesAnimationTo; 246 String m_lastValuesAnimationTo;
247 bool m_hasInvalidCSSAttributeType;
239 }; 248 };
240 249
241 } // namespace WebCore 250 } // namespace WebCore
242 251
243 #endif // ENABLE(SVG) 252 #endif // ENABLE(SVG)
244 #endif // SVGAnimationElement_h 253 #endif // SVGAnimationElement_h
OLDNEW
« no previous file with comments | « Source/WebCore/svg/SVGAnimateElement.cpp ('k') | Source/WebCore/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698