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

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

Issue 901193002: De-ExceptionState-ify SVGLengthContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGLengthContext.cpp ('k') | Source/core/svg/SVGLengthTearOff.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, 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 void SVGLengthList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElemen t* contextElement) 120 void SVGLengthList::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElemen t* contextElement)
121 { 121 {
122 RefPtrWillBeRawPtr<SVGLengthList> otherList = toSVGLengthList(other); 122 RefPtrWillBeRawPtr<SVGLengthList> otherList = toSVGLengthList(other);
123 123
124 if (length() != otherList->length()) 124 if (length() != otherList->length())
125 return; 125 return;
126 126
127 SVGLengthContext lengthContext(contextElement); 127 SVGLengthContext lengthContext(contextElement);
128 for (size_t i = 0; i < length(); ++i) 128 for (size_t i = 0; i < length(); ++i)
129 at(i)->setValue(at(i)->value(lengthContext) + otherList->at(i)->value(le ngthContext), lengthContext, ASSERT_NO_EXCEPTION); 129 at(i)->setValue(at(i)->value(lengthContext) + otherList->at(i)->value(le ngthContext), lengthContext);
130 } 130 }
131 131
132 PassRefPtrWillBeRawPtr<SVGLength> SVGLengthList::createPaddingItem() const 132 PassRefPtrWillBeRawPtr<SVGLength> SVGLengthList::createPaddingItem() const
133 { 133 {
134 return SVGLength::create(m_mode); 134 return SVGLength::create(m_mode);
135 } 135 }
136 136
137 void SVGLengthList::calculateAnimatedValue(SVGAnimationElement* animationElement , float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase > fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRa wPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement) 137 void SVGLengthList::calculateAnimatedValue(SVGAnimationElement* animationElement , float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase > fromValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRa wPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement)
138 { 138 {
139 RefPtrWillBeRawPtr<SVGLengthList> fromList = toSVGLengthList(fromValue); 139 RefPtrWillBeRawPtr<SVGLengthList> fromList = toSVGLengthList(fromValue);
(...skipping 17 matching lines...) Expand all
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)->unitType();
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, ASSERT_NO_EXCEPTION); 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.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698