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

Side by Side Diff: Source/core/svg/SVGLengthList.cpp

Issue 1162453002: [svg2] Make SVGLength wrap a CSSPrimitiveValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | Source/core/svg/SVGLengthTearOff.h » ('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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 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 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 size_t fromLengthListSize = fromList->length(); 146 size_t fromLengthListSize = fromList->length();
147 size_t toLengthListSize = toList->length(); 147 size_t toLengthListSize = toList->length();
148 size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length(); 148 size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length();
149 149
150 if (!adjustFromToListValues(fromList, toList, percentage, animationElement-> animationMode())) 150 if (!adjustFromToListValues(fromList, toList, percentage, animationElement-> animationMode()))
151 return; 151 return;
152 152
153 for (size_t i = 0; i < toLengthListSize; ++i) { 153 for (size_t i = 0; i < toLengthListSize; ++i) {
154 float animatedNumber = at(i)->value(lengthContext); 154 float animatedNumber = at(i)->value(lengthContext);
155 SVGLengthType unitType = toList->at(i)->unitType(); 155 CSSPrimitiveValue::UnitType unitType = toList->at(i)->primitiveType();
156 float effectiveFrom = 0; 156 float effectiveFrom = 0;
157 if (fromLengthListSize) { 157 if (fromLengthListSize) {
158 if (percentage < 0.5) 158 if (percentage < 0.5)
159 unitType = fromList->at(i)->unitType(); 159 unitType = fromList->at(i)->primitiveType();
160 effectiveFrom = fromList->at(i)->value(lengthContext); 160 effectiveFrom = fromList->at(i)->value(lengthContext);
161 } 161 }
162 float effectiveTo = toList->at(i)->value(lengthContext); 162 float effectiveTo = toList->at(i)->value(lengthContext);
163 float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurati onList->at(i)->value(lengthContext) : 0; 163 float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurati onList->at(i)->value(lengthContext) : 0;
164 164
165 animationElement->animateAdditiveNumber(percentage, repeatCount, effecti veFrom, effectiveTo, effectiveToAtEnd, animatedNumber); 165 animationElement->animateAdditiveNumber(percentage, repeatCount, effecti veFrom, effectiveTo, effectiveToAtEnd, animatedNumber);
166 at(i)->setUnitType(unitType); 166 at(i)->setUnitType(unitType);
167 at(i)->setValue(animatedNumber, lengthContext); 167 at(i)->setValue(animatedNumber, lengthContext);
168 } 168 }
169 } 169 }
170 170
171 float SVGLengthList::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> t o, SVGElement*) 171 float SVGLengthList::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> t o, SVGElement*)
172 { 172 {
173 // FIXME: Distance calculation is not possible for SVGLengthList right now. We need the distance for every single value. 173 // FIXME: Distance calculation is not possible for SVGLengthList right now. We need the distance for every single value.
174 return -1; 174 return -1;
175 } 175 }
176 } 176 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | Source/core/svg/SVGLengthTearOff.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698