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

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

Issue 208133002: [SVG] Remove "New" prefix from properties implementation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/SVGPathSegList.h ('k') | Source/core/svg/SVGPathSegListTearOff.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, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 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) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 } 59 }
60 60
61 PassRefPtr<SVGPathSegList> SVGPathSegList::clone() 61 PassRefPtr<SVGPathSegList> SVGPathSegList::clone()
62 { 62 {
63 RefPtr<SVGPathSegList> svgPathSegList = adoptRef(new SVGPathSegList(m_contex tElement, m_role, byteStream()->copy())); 63 RefPtr<SVGPathSegList> svgPathSegList = adoptRef(new SVGPathSegList(m_contex tElement, m_role, byteStream()->copy()));
64 svgPathSegList->invalidateList(); 64 svgPathSegList->invalidateList();
65 return svgPathSegList.release(); 65 return svgPathSegList.release();
66 } 66 }
67 67
68 PassRefPtr<NewSVGPropertyBase> SVGPathSegList::cloneForAnimation(const String& v alue) const 68 PassRefPtr<SVGPropertyBase> SVGPathSegList::cloneForAnimation(const String& valu e) const
69 { 69 {
70 RefPtr<SVGPathSegList> svgPathSegList = SVGPathSegList::create(m_contextElem ent); 70 RefPtr<SVGPathSegList> svgPathSegList = SVGPathSegList::create(m_contextElem ent);
71 svgPathSegList->setValueAsString(value, IGNORE_EXCEPTION); 71 svgPathSegList->setValueAsString(value, IGNORE_EXCEPTION);
72 return svgPathSegList; 72 return svgPathSegList;
73 } 73 }
74 74
75 const SVGPathByteStream* SVGPathSegList::byteStream() const 75 const SVGPathByteStream* SVGPathSegList::byteStream() const
76 { 76 {
77 if (!m_byteStream) { 77 if (!m_byteStream) {
78 m_byteStream = SVGPathByteStream::create(); 78 m_byteStream = SVGPathByteStream::create();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 void SVGPathSegList::setValueAsString(const String& string, ExceptionState& exce ptionState) 153 void SVGPathSegList::setValueAsString(const String& string, ExceptionState& exce ptionState)
154 { 154 {
155 invalidateList(); 155 invalidateList();
156 if (!m_byteStream) 156 if (!m_byteStream)
157 m_byteStream = SVGPathByteStream::create(); 157 m_byteStream = SVGPathByteStream::create();
158 if (!buildSVGPathByteStreamFromString(string, m_byteStream.get(), UnalteredP arsing)) 158 if (!buildSVGPathByteStreamFromString(string, m_byteStream.get(), UnalteredP arsing))
159 exceptionState.throwDOMException(SyntaxError, "Problem parsing path \"" + string + "\""); 159 exceptionState.throwDOMException(SyntaxError, "Problem parsing path \"" + string + "\"");
160 } 160 }
161 161
162 void SVGPathSegList::add(PassRefPtr<NewSVGPropertyBase> other, SVGElement*) 162 void SVGPathSegList::add(PassRefPtr<SVGPropertyBase> other, SVGElement*)
163 { 163 {
164 RefPtr<SVGPathSegList> otherList = toSVGPathSegList(other); 164 RefPtr<SVGPathSegList> otherList = toSVGPathSegList(other);
165 if (length() != otherList->length()) 165 if (length() != otherList->length())
166 return; 166 return;
167 167
168 byteStream(); // create |m_byteStream| if not exist. 168 byteStream(); // create |m_byteStream| if not exist.
169 addToSVGPathByteStream(m_byteStream.get(), otherList->byteStream()); 169 addToSVGPathByteStream(m_byteStream.get(), otherList->byteStream());
170 invalidateList(); 170 invalidateList();
171 } 171 }
172 172
173 void SVGPathSegList::calculateAnimatedValue(SVGAnimationElement* animationElemen t, float percentage, unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> fromVa lue, PassRefPtr<NewSVGPropertyBase> toValue, PassRefPtr<NewSVGPropertyBase> toAt EndOfDurationValue, SVGElement*) 173 void SVGPathSegList::calculateAnimatedValue(SVGAnimationElement* animationElemen t, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue , PassRefPtr<SVGPropertyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDura tionValue, SVGElement*)
174 { 174 {
175 invalidateList(); 175 invalidateList();
176 176
177 ASSERT(animationElement); 177 ASSERT(animationElement);
178 bool isToAnimation = animationElement->animationMode() == ToAnimation; 178 bool isToAnimation = animationElement->animationMode() == ToAnimation;
179 179
180 const RefPtr<SVGPathSegList> from = toSVGPathSegList(fromValue); 180 const RefPtr<SVGPathSegList> from = toSVGPathSegList(fromValue);
181 const RefPtr<SVGPathSegList> to = toSVGPathSegList(toValue); 181 const RefPtr<SVGPathSegList> to = toSVGPathSegList(toValue);
182 const RefPtr<SVGPathSegList> toAtEndOfDuration = toSVGPathSegList(toAtEndOfD urationValue); 182 const RefPtr<SVGPathSegList> toAtEndOfDuration = toSVGPathSegList(toAtEndOfD urationValue);
183 183
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!fromStream->size() || (animationElement->isAdditive() && !isToAnimation )) 223 if (!fromStream->size() || (animationElement->isAdditive() && !isToAnimation ))
224 addToSVGPathByteStream(m_byteStream.get(), lastAnimatedStream.get()); 224 addToSVGPathByteStream(m_byteStream.get(), lastAnimatedStream.get());
225 225
226 // Handle accumulate='sum'. 226 // Handle accumulate='sum'.
227 if (animationElement->isAccumulated() && repeatCount) { 227 if (animationElement->isAccumulated() && repeatCount) {
228 const SVGPathByteStream* toAtEndOfDurationStream = toAtEndOfDuration->by teStream(); 228 const SVGPathByteStream* toAtEndOfDurationStream = toAtEndOfDuration->by teStream();
229 addToSVGPathByteStream(m_byteStream.get(), toAtEndOfDurationStream, repe atCount); 229 addToSVGPathByteStream(m_byteStream.get(), toAtEndOfDurationStream, repe atCount);
230 } 230 }
231 } 231 }
232 232
233 float SVGPathSegList::calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGEl ement*) 233 float SVGPathSegList::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGEleme nt*)
234 { 234 {
235 // FIXME: Support paced animations. 235 // FIXME: Support paced animations.
236 return -1; 236 return -1;
237 } 237 }
238 238
239 } 239 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathSegList.h ('k') | Source/core/svg/SVGPathSegListTearOff.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698