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

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

Issue 1643243002: Refactor parsing in SVGTransformList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore error-behavior for create(SVGTransformType, const String&) Created 4 years, 10 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 | « no previous file | no next file » | 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 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) Research In Motion Limited 2012. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2012. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 28 matching lines...) Expand all
39 SVGTransformList::~SVGTransformList() 39 SVGTransformList::~SVGTransformList()
40 { 40 {
41 } 41 }
42 42
43 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformList::consolidate() 43 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformList::consolidate()
44 { 44 {
45 AffineTransform matrix; 45 AffineTransform matrix;
46 if (!concatenate(matrix)) 46 if (!concatenate(matrix))
47 return SVGTransform::create(); 47 return SVGTransform::create();
48 48
49 RefPtrWillBeRawPtr<SVGTransform> transform = SVGTransform::create(matrix); 49 return initialize(SVGTransform::create(matrix));
50 clear();
51 return appendItem(transform);
52 } 50 }
53 51
54 bool SVGTransformList::concatenate(AffineTransform& result) const 52 bool SVGTransformList::concatenate(AffineTransform& result) const
55 { 53 {
56 if (isEmpty()) 54 if (isEmpty())
57 return false; 55 return false;
58 56
59 ConstIterator it = begin(); 57 ConstIterator it = begin();
60 ConstIterator itEnd = end(); 58 ConstIterator itEnd = end();
61 for (; it != itEnd; ++it) 59 for (; it != itEnd; ++it)
62 result *= it->matrix(); 60 result *= it->matrix();
63 61
64 return true; 62 return true;
65 } 63 }
66 64
67 namespace { 65 namespace {
68 66
69 const LChar skewXDesc[] = {'s', 'k', 'e', 'w', 'X'}; 67 const LChar skewXDesc[] = {'s', 'k', 'e', 'w', 'X'};
70 const LChar skewYDesc[] = {'s', 'k', 'e', 'w', 'Y'}; 68 const LChar skewYDesc[] = {'s', 'k', 'e', 'w', 'Y'};
71 const LChar scaleDesc[] = {'s', 'c', 'a', 'l', 'e'}; 69 const LChar scaleDesc[] = {'s', 'c', 'a', 'l', 'e'};
72 const LChar translateDesc[] = {'t', 'r', 'a', 'n', 's', 'l', 'a', 't', 'e'}; 70 const LChar translateDesc[] = {'t', 'r', 'a', 'n', 's', 'l', 'a', 't', 'e'};
73 const LChar rotateDesc[] = {'r', 'o', 't', 'a', 't', 'e'}; 71 const LChar rotateDesc[] = {'r', 'o', 't', 'a', 't', 'e'};
74 const LChar matrixDesc[] = {'m', 'a', 't', 'r', 'i', 'x'}; 72 const LChar matrixDesc[] = {'m', 'a', 't', 'r', 'i', 'x'};
75 73
76 template<typename CharType> 74 template<typename CharType>
77 bool parseAndSkipTransformType(const CharType*& ptr, const CharType* end, SVGTra nsformType& type) 75 SVGTransformType parseAndSkipTransformType(const CharType*& ptr, const CharType* end)
78 { 76 {
79 if (ptr >= end) 77 if (ptr >= end)
80 return false; 78 return SVG_TRANSFORM_UNKNOWN;
81 79
82 if (*ptr == 's') { 80 if (*ptr == 's') {
83 if (skipString(ptr, end, skewXDesc, WTF_ARRAY_LENGTH(skewXDesc))) 81 if (skipString(ptr, end, skewXDesc, WTF_ARRAY_LENGTH(skewXDesc)))
84 type = SVG_TRANSFORM_SKEWX; 82 return SVG_TRANSFORM_SKEWX;
85 else if (skipString(ptr, end, skewYDesc, WTF_ARRAY_LENGTH(skewYDesc))) 83 if (skipString(ptr, end, skewYDesc, WTF_ARRAY_LENGTH(skewYDesc)))
86 type = SVG_TRANSFORM_SKEWY; 84 return SVG_TRANSFORM_SKEWY;
87 else if (skipString(ptr, end, scaleDesc, WTF_ARRAY_LENGTH(scaleDesc))) 85 if (skipString(ptr, end, scaleDesc, WTF_ARRAY_LENGTH(scaleDesc)))
88 type = SVG_TRANSFORM_SCALE; 86 return SVG_TRANSFORM_SCALE;
89 else 87
90 return false; 88 return SVG_TRANSFORM_UNKNOWN;
91 } else if (skipString(ptr, end, translateDesc, WTF_ARRAY_LENGTH(translateDes c))) {
92 type = SVG_TRANSFORM_TRANSLATE;
93 } else if (skipString(ptr, end, rotateDesc, WTF_ARRAY_LENGTH(rotateDesc))) {
94 type = SVG_TRANSFORM_ROTATE;
95 } else if (skipString(ptr, end, matrixDesc, WTF_ARRAY_LENGTH(matrixDesc))) {
96 type = SVG_TRANSFORM_MATRIX;
97 } else {
98 return false;
99 } 89 }
100 return true; 90 if (skipString(ptr, end, translateDesc, WTF_ARRAY_LENGTH(translateDesc)))
91 return SVG_TRANSFORM_TRANSLATE;
92 if (skipString(ptr, end, rotateDesc, WTF_ARRAY_LENGTH(rotateDesc)))
93 return SVG_TRANSFORM_ROTATE;
94 if (skipString(ptr, end, matrixDesc, WTF_ARRAY_LENGTH(matrixDesc)))
95 return SVG_TRANSFORM_MATRIX;
96
97 return SVG_TRANSFORM_UNKNOWN;
101 } 98 }
102 99
100 // These should be kept in sync with enum SVGTransformType
f(malita) 2016/01/29 20:51:14 Nit: in cases like this, I normally add static ass
fs 2016/01/29 21:48:13 Since these (enums) are web exposed API (and unlik
fs 2016/02/01 13:36:20 Asserts added.
101 const unsigned requiredValuesForType[] = {0, 6, 1, 1, 1, 1, 1};
102 const unsigned optionalValuesForType[] = {0, 0, 1, 1, 2, 0, 0};
103 const unsigned MaxTransformArguments = 6;
f(malita) 2016/01/29 20:51:14 Nit: kMaxTransformArguments? Or am I getting them
fs 2016/01/29 21:48:13 kFoo is "where we're going" (Chromium Style). I su
fs 2016/02/01 13:36:20 Changed to k-prefixed.
104
105 using TransformArguments = Vector<float, MaxTransformArguments>;
106
103 template<typename CharType> 107 template<typename CharType>
104 int parseTransformParamList(const CharType*& ptr, const CharType* end, float* va lues, int required, int optional) 108 int parseTransformArgumentsForType(
109 SVGTransformType type,
110 const CharType*& ptr, const CharType* end,
111 TransformArguments& arguments)
105 { 112 {
106 int parsedParams = 0; 113 const size_t required = requiredValuesForType[type];
107 int maxPossibleParams = required + optional; 114 const size_t optional = optionalValuesForType[type];
115 const size_t maxPossibleParams = required + optional;
f(malita) 2016/01/29 20:51:14 Nit: just in case these end up changing - ASSERT(
fs 2016/02/01 13:36:20 Done.
116 ASSERT(arguments.isEmpty());
108 117
109 bool trailingDelimiter = false; 118 bool trailingDelimiter = false;
110 119
111 skipOptionalSVGSpaces(ptr, end); 120 while (arguments.size() < maxPossibleParams) {
112 while (parsedParams < maxPossibleParams) { 121 float argumentValue = 0;
113 if (!parseNumber(ptr, end, values[parsedParams], DisallowWhitespace)) 122 if (!parseNumber(ptr, end, argumentValue, AllowLeadingWhitespace))
114 break; 123 break;
115 124
116 ++parsedParams; 125 arguments.append(argumentValue);
126 trailingDelimiter = false;
127
128 if (arguments.size() == maxPossibleParams)
f(malita) 2016/01/29 20:51:14 Aren't we breaking too early here? It looks like
fs 2016/01/29 21:48:13 This was born out of a wish to get better error re
fs 2016/02/01 13:36:20 Tightened up SVGTransformList::create(SVGTransform
129 break;
117 130
118 if (skipOptionalSVGSpaces(ptr, end) && *ptr == ',') { 131 if (skipOptionalSVGSpaces(ptr, end) && *ptr == ',') {
119 ++ptr; 132 ++ptr;
120 skipOptionalSVGSpaces(ptr, end);
121
122 trailingDelimiter = true; 133 trailingDelimiter = true;
123 } else {
124 trailingDelimiter = false;
125 } 134 }
126 } 135 }
127 136
128 if (trailingDelimiter || !(parsedParams == required || parsedParams == maxPo ssibleParams)) 137 if (trailingDelimiter || !(arguments.size() == required || arguments.size() == maxPossibleParams))
129 return -1; 138 return -1;
130 139
131 return parsedParams; 140 return safeCast<int>(arguments.size());
132 } 141 }
133 142
134 // These should be kept in sync with enum SVGTransformType 143 PassRefPtrWillBeRawPtr<SVGTransform> createTransformFromValues(SVGTransformType type, const TransformArguments& arguments)
135 const int requiredValuesForType[] = {0, 6, 1, 1, 1, 1, 1};
136 const int optionalValuesForType[] = {0, 0, 1, 1, 2, 0, 0};
137
138 template<typename CharType>
139 PassRefPtrWillBeRawPtr<SVGTransform> parseTransformOfType(unsigned type, const C harType*& ptr, const CharType* end)
140 { 144 {
141 if (type == SVG_TRANSFORM_UNKNOWN)
142 return nullptr;
143
144 int valueCount = 0;
145 float values[] = {0, 0, 0, 0, 0, 0};
146 if ((valueCount = parseTransformParamList(ptr, end, values, requiredValuesFo rType[type], optionalValuesForType[type])) < 0) {
147 return nullptr;
148 }
149
150 RefPtrWillBeRawPtr<SVGTransform> transform = SVGTransform::create(); 145 RefPtrWillBeRawPtr<SVGTransform> transform = SVGTransform::create();
151
152 switch (type) { 146 switch (type) {
153 case SVG_TRANSFORM_SKEWX: 147 case SVG_TRANSFORM_SKEWX:
154 transform->setSkewX(values[0]); 148 transform->setSkewX(arguments[0]);
155 break; 149 break;
156 case SVG_TRANSFORM_SKEWY: 150 case SVG_TRANSFORM_SKEWY:
157 transform->setSkewY(values[0]); 151 transform->setSkewY(arguments[0]);
158 break; 152 break;
159 case SVG_TRANSFORM_SCALE: 153 case SVG_TRANSFORM_SCALE:
160 if (valueCount == 1) // Spec: if only one param given, assume uniform sc aling 154 // Spec: if only one param given, assume uniform scaling.
161 transform->setScale(values[0], values[0]); 155 if (arguments.size() == 1)
156 transform->setScale(arguments[0], arguments[0]);
162 else 157 else
163 transform->setScale(values[0], values[1]); 158 transform->setScale(arguments[0], arguments[1]);
164 break; 159 break;
165 case SVG_TRANSFORM_TRANSLATE: 160 case SVG_TRANSFORM_TRANSLATE:
166 if (valueCount == 1) // Spec: if only one param given, assume 2nd param to be 0 161 // Spec: if only one param given, assume 2nd param to be 0.
167 transform->setTranslate(values[0], 0); 162 if (arguments.size() == 1)
163 transform->setTranslate(arguments[0], 0);
168 else 164 else
169 transform->setTranslate(values[0], values[1]); 165 transform->setTranslate(arguments[0], arguments[1]);
170 break; 166 break;
171 case SVG_TRANSFORM_ROTATE: 167 case SVG_TRANSFORM_ROTATE:
172 if (valueCount == 1) 168 if (arguments.size() == 1)
173 transform->setRotate(values[0], 0, 0); 169 transform->setRotate(arguments[0], 0, 0);
174 else 170 else
175 transform->setRotate(values[0], values[1], values[2]); 171 transform->setRotate(arguments[0], arguments[1], arguments[2]);
176 break; 172 break;
177 case SVG_TRANSFORM_MATRIX: 173 case SVG_TRANSFORM_MATRIX:
178 transform->setMatrix(AffineTransform(values[0], values[1], values[2], va lues[3], values[4], values[5])); 174 transform->setMatrix(AffineTransform(arguments[0], arguments[1], argumen ts[2], arguments[3], arguments[4], arguments[5]));
175 break;
176 case SVG_TRANSFORM_UNKNOWN:
177 ASSERT_NOT_REACHED();
179 break; 178 break;
180 } 179 }
181
182 return transform.release(); 180 return transform.release();
183 } 181 }
184 182
185 } // namespace 183 } // namespace
186 184
187 template<typename CharType> 185 template<typename CharType>
188 bool SVGTransformList::parseInternal(const CharType*& ptr, const CharType* end) 186 bool SVGTransformList::parseInternal(const CharType*& ptr, const CharType* end)
189 { 187 {
190 clear(); 188 clear();
191 189
192 bool delimParsed = false; 190 bool delimParsed = false;
193 while (ptr < end) { 191 while (skipOptionalSVGSpaces(ptr, end)) {
194 delimParsed = false; 192 delimParsed = false;
195 SVGTransformType transformType = SVG_TRANSFORM_UNKNOWN;
196 skipOptionalSVGSpaces(ptr, end);
197 193
198 if (!parseAndSkipTransformType(ptr, end, transformType)) 194 SVGTransformType transformType = parseAndSkipTransformType(ptr, end);
195 if (transformType == SVG_TRANSFORM_UNKNOWN)
199 return false; 196 return false;
200 197
201 if (!skipOptionalSVGSpaces(ptr, end) || *ptr != '(') 198 if (!skipOptionalSVGSpaces(ptr, end) || *ptr != '(')
202 return false; 199 return false;
203 ptr++; 200 ptr++;
204 201
205 RefPtrWillBeRawPtr<SVGTransform> transform = parseTransformOfType(transf ormType, ptr, end); 202 TransformArguments arguments;
206 if (!transform) 203 int valueCount = parseTransformArgumentsForType(transformType, ptr, end, arguments);
204 if (valueCount < 0)
207 return false; 205 return false;
f(malita) 2016/01/29 20:51:14 Nit: ASSERT(valueCount >= requiredValuesForType[t
fs 2016/02/01 13:36:20 Done.
208 206
209 if (!skipOptionalSVGSpaces(ptr, end) || *ptr != ')') 207 if (!skipOptionalSVGSpaces(ptr, end) || *ptr != ')')
210 return false; 208 return false;
211 ptr++; 209 ptr++;
212 210
213 append(transform.release()); 211 append(createTransformFromValues(transformType, arguments));
214 212
215 skipOptionalSVGSpaces(ptr, end); 213 if (skipOptionalSVGSpaces(ptr, end) && *ptr == ',') {
216 if (ptr < end && *ptr == ',') { 214 ++ptr;
217 delimParsed = true; 215 delimParsed = true;
218 ++ptr;
219 skipOptionalSVGSpaces(ptr, end);
220 } 216 }
221 } 217 }
222
223 return !delimParsed; 218 return !delimParsed;
224 } 219 }
225 220
226 bool SVGTransformList::parse(const UChar*& ptr, const UChar* end) 221 bool SVGTransformList::parse(const UChar*& ptr, const UChar* end)
227 { 222 {
228 return parseInternal(ptr, end); 223 return parseInternal(ptr, end);
229 } 224 }
230 225
231 bool SVGTransformList::parse(const LChar*& ptr, const LChar* end) 226 bool SVGTransformList::parse(const LChar*& ptr, const LChar* end)
232 { 227 {
233 return parseInternal(ptr, end); 228 return parseInternal(ptr, end);
234 } 229 }
235 230
236 SVGTransformType parseTransformType(const String& string) 231 SVGTransformType parseTransformType(const String& string)
237 { 232 {
238 if (string.isEmpty()) 233 if (string.isEmpty())
239 return SVG_TRANSFORM_UNKNOWN; 234 return SVG_TRANSFORM_UNKNOWN;
240 SVGTransformType type = SVG_TRANSFORM_UNKNOWN;
241 if (string.is8Bit()) { 235 if (string.is8Bit()) {
242 const LChar* ptr = string.characters8(); 236 const LChar* ptr = string.characters8();
243 const LChar* end = ptr + string.length(); 237 const LChar* end = ptr + string.length();
244 parseAndSkipTransformType(ptr, end, type); 238 return parseAndSkipTransformType(ptr, end);
245 } else {
246 const UChar* ptr = string.characters16();
247 const UChar* end = ptr + string.length();
248 parseAndSkipTransformType(ptr, end, type);
249 } 239 }
250 return type; 240 const UChar* ptr = string.characters16();
241 const UChar* end = ptr + string.length();
242 return parseAndSkipTransformType(ptr, end);
251 } 243 }
252 244
253 String SVGTransformList::valueAsString() const 245 String SVGTransformList::valueAsString() const
254 { 246 {
255 StringBuilder builder; 247 StringBuilder builder;
256 248
257 ConstIterator it = begin(); 249 ConstIterator it = begin();
258 ConstIterator itEnd = end(); 250 ConstIterator itEnd = end();
259 while (it != itEnd) { 251 while (it != itEnd) {
260 builder.append(it->valueAsString()); 252 builder.append(it->valueAsString());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 285 }
294 286
295 PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGTransformList::cloneForAnimation(cons t String& value) const 287 PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGTransformList::cloneForAnimation(cons t String& value) const
296 { 288 {
297 ASSERT(RuntimeEnabledFeatures::webAnimationsSVGEnabled()); 289 ASSERT(RuntimeEnabledFeatures::webAnimationsSVGEnabled());
298 return SVGListPropertyHelper::cloneForAnimation(value); 290 return SVGListPropertyHelper::cloneForAnimation(value);
299 } 291 }
300 292
301 PassRefPtrWillBeRawPtr<SVGTransformList> SVGTransformList::create(SVGTransformTy pe transformType, const String& value) 293 PassRefPtrWillBeRawPtr<SVGTransformList> SVGTransformList::create(SVGTransformTy pe transformType, const String& value)
302 { 294 {
303 RefPtrWillBeRawPtr<SVGTransform> transform = nullptr; 295 TransformArguments arguments;
296 int valueCount = -1;
304 if (value.isEmpty()) { 297 if (value.isEmpty()) {
305 } else if (value.is8Bit()) { 298 } else if (value.is8Bit()) {
306 const LChar* ptr = value.characters8(); 299 const LChar* ptr = value.characters8();
307 const LChar* end = ptr + value.length(); 300 const LChar* end = ptr + value.length();
308 transform = parseTransformOfType(transformType, ptr, end); 301 valueCount = parseTransformArgumentsForType(transformType, ptr, end, arg uments);
309 } else { 302 } else {
310 const UChar* ptr = value.characters16(); 303 const UChar* ptr = value.characters16();
311 const UChar* end = ptr + value.length(); 304 const UChar* end = ptr + value.length();
312 transform = parseTransformOfType(transformType, ptr, end); 305 valueCount = parseTransformArgumentsForType(transformType, ptr, end, arg uments);
313 } 306 }
314 307
315 RefPtrWillBeRawPtr<SVGTransformList> svgTransformList = SVGTransformList::cr eate(); 308 RefPtrWillBeRawPtr<SVGTransformList> svgTransformList = SVGTransformList::cr eate();
316 if (transform) 309 if (valueCount > 0)
317 svgTransformList->append(transform); 310 svgTransformList->append(createTransformFromValues(transformType, argume nts));
318 return svgTransformList.release(); 311 return svgTransformList.release();
319 } 312 }
320 313
321 void SVGTransformList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGEle ment* contextElement) 314 void SVGTransformList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGEle ment* contextElement)
322 { 315 {
323 if (isEmpty()) 316 if (isEmpty())
324 return; 317 return;
325 318
326 RefPtrWillBeRawPtr<SVGTransformList> otherList = toSVGTransformList(other); 319 RefPtrWillBeRawPtr<SVGTransformList> otherList = toSVGTransformList(other);
327 if (length() != otherList->length()) 320 if (length() != otherList->length())
328 return; 321 return;
329 322
330 ASSERT(length() == 1); 323 ASSERT(length() == 1);
331 RefPtrWillBeRawPtr<SVGTransform> fromTransform = at(0); 324 RefPtrWillBeRawPtr<SVGTransform> fromTransform = at(0);
332 RefPtrWillBeRawPtr<SVGTransform> toTransform = otherList->at(0); 325 RefPtrWillBeRawPtr<SVGTransform> toTransform = otherList->at(0);
333 326
334 ASSERT(fromTransform->transformType() == toTransform->transformType()); 327 ASSERT(fromTransform->transformType() == toTransform->transformType());
335 clear(); 328 initialize(SVGTransformDistance::addSVGTransforms(fromTransform, toTransform ));
336 append(SVGTransformDistance::addSVGTransforms(fromTransform, toTransform));
337 } 329 }
338 330
339 void SVGTransformList::calculateAnimatedValue(SVGAnimationElement* animationElem ent, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyB ase> fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement) 331 void SVGTransformList::calculateAnimatedValue(SVGAnimationElement* animationElem ent, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyB ase> fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement)
340 { 332 {
341 ASSERT(animationElement); 333 ASSERT(animationElement);
342 bool isToAnimation = animationElement->animationMode() == ToAnimation; 334 bool isToAnimation = animationElement->animationMode() == ToAnimation;
343 335
344 // Spec: To animations provide specific functionality to get a smooth change from the underlying value to the 336 // Spec: To animations provide specific functionality to get a smooth change from the underlying value to the
345 // 'to' attribute value, which conflicts mathematically with the requirement for additive transform animations 337 // 'to' attribute value, which conflicts mathematically with the requirement for additive transform animations
346 // to be post-multiplied. As a consequence, in SVG 1.1 the behavior of to an imations for 'animateTransform' is undefined 338 // to be post-multiplied. As a consequence, in SVG 1.1 the behavior of to an imations for 'animateTransform' is undefined
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (at(0)->transformType() == toList->at(0)->transformType()) 380 if (at(0)->transformType() == toList->at(0)->transformType())
389 return -1; 381 return -1;
390 382
391 // Spec: http://www.w3.org/TR/SVG/animate.html#complexDistances 383 // Spec: http://www.w3.org/TR/SVG/animate.html#complexDistances
392 // Paced animations assume a notion of distance between the various animatio n values defined by the 'to', 'from', 'by' and 'values' attributes. 384 // Paced animations assume a notion of distance between the various animatio n values defined by the 'to', 'from', 'by' and 'values' attributes.
393 // Distance is defined only for scalar types (such as <length>), colors and the subset of transformation types that are supported by 'animateTransform'. 385 // Distance is defined only for scalar types (such as <length>), colors and the subset of transformation types that are supported by 'animateTransform'.
394 return SVGTransformDistance(at(0), toList->at(0)).distance(); 386 return SVGTransformDistance(at(0), toList->at(0)).distance();
395 } 387 }
396 388
397 } // namespace blink 389 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698