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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp

Issue 1588993005: Extended error reporting for SVG attribute parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 4 years, 11 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, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 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) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 result.clear(); 156 result.clear();
157 return false; 157 return false;
158 } 158 }
159 return true; 159 return true;
160 } 160 }
161 161
162 void SVGAnimationElement::parseAttribute(const QualifiedName& name, const Atomic String& oldValue, const AtomicString& value) 162 void SVGAnimationElement::parseAttribute(const QualifiedName& name, const Atomic String& oldValue, const AtomicString& value)
163 { 163 {
164 if (name == SVGNames::valuesAttr) { 164 if (name == SVGNames::valuesAttr) {
165 if (!parseValues(value, m_values)) { 165 if (!parseValues(value, m_values)) {
166 reportAttributeParsingError(ParsingAttributeFailedError, name, value ); 166 reportAttributeParsingError(SVGStatus::ParsingFailed, name, value);
167 return; 167 return;
168 } 168 }
169 updateAnimationMode(); 169 updateAnimationMode();
170 return; 170 return;
171 } 171 }
172 172
173 if (name == SVGNames::keyTimesAttr) { 173 if (name == SVGNames::keyTimesAttr) {
174 if (!parseKeyTimes(value, m_keyTimes, true)) 174 if (!parseKeyTimes(value, m_keyTimes, true))
175 reportAttributeParsingError(ParsingAttributeFailedError, name, value ); 175 reportAttributeParsingError(SVGStatus::ParsingFailed, name, value);
176 return; 176 return;
177 } 177 }
178 178
179 if (name == SVGNames::keyPointsAttr) { 179 if (name == SVGNames::keyPointsAttr) {
180 if (isSVGAnimateMotionElement(*this)) { 180 if (isSVGAnimateMotionElement(*this)) {
181 // This is specified to be an animateMotion attribute only but it is simpler to put it here 181 // This is specified to be an animateMotion attribute only but it is simpler to put it here
182 // where the other timing calculatations are. 182 // where the other timing calculatations are.
183 if (!parseKeyTimes(value, m_keyPoints, false)) 183 if (!parseKeyTimes(value, m_keyPoints, false))
184 reportAttributeParsingError(ParsingAttributeFailedError, name, v alue); 184 reportAttributeParsingError(SVGStatus::ParsingFailed, name, valu e);
185 } 185 }
186 return; 186 return;
187 } 187 }
188 188
189 if (name == SVGNames::keySplinesAttr) { 189 if (name == SVGNames::keySplinesAttr) {
190 if (!parseKeySplines(value, m_keySplines)) 190 if (!parseKeySplines(value, m_keySplines))
191 reportAttributeParsingError(ParsingAttributeFailedError, name, value ); 191 reportAttributeParsingError(SVGStatus::ParsingFailed, name, value);
192 return; 192 return;
193 } 193 }
194 194
195 if (name == SVGNames::attributeTypeAttr) { 195 if (name == SVGNames::attributeTypeAttr) {
196 setAttributeType(value); 196 setAttributeType(value);
197 return; 197 return;
198 } 198 }
199 199
200 if (name == SVGNames::calcModeAttr) { 200 if (name == SVGNames::calcModeAttr) {
201 setCalcMode(value); 201 setCalcMode(value);
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 if (!hasInvalidCSSAttributeType) 724 if (!hasInvalidCSSAttributeType)
725 schedule(); 725 schedule();
726 } 726 }
727 727
728 // Clear values that may depend on the previous target. 728 // Clear values that may depend on the previous target.
729 if (targetElement()) 729 if (targetElement())
730 clearAnimatedType(); 730 clearAnimatedType();
731 } 731 }
732 732
733 } 733 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698