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

Unified Diff: Source/core/svg/SVGPointList.cpp

Issue 195313003: [SVG2] Add getters and setters to SVG*List interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/slength/size 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGPathSegList.idl ('k') | Source/core/svg/SVGPointList.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPointList.cpp
diff --git a/Source/core/svg/SVGPointList.cpp b/Source/core/svg/SVGPointList.cpp
index 3b1e3e29ce0d691130dd59ec6d6261d9a8ea4c5e..09e01a4e3eca8f4016abc9a0654c5674abebdc9a 100644
--- a/Source/core/svg/SVGPointList.cpp
+++ b/Source/core/svg/SVGPointList.cpp
@@ -136,10 +136,10 @@ void SVGPointList::add(PassRefPtr<NewSVGPropertyBase> other, SVGElement* context
{
RefPtr<SVGPointList> otherList = toSVGPointList(other);
- if (numberOfItems() != otherList->numberOfItems())
+ if (length() != otherList->length())
return;
- for (size_t i = 0; i < numberOfItems(); ++i)
+ for (size_t i = 0; i < length(); ++i)
at(i)->setValue(at(i)->value() + otherList->at(i)->value());
}
@@ -149,12 +149,12 @@ bool SVGPointList::adjustFromToListValues(PassRefPtr<SVGPointList> passFromList,
RefPtr<SVGPointList> toList = passToList;
// If no 'to' value is given, nothing to animate.
- size_t toListSize = toList->numberOfItems();
+ size_t toListSize = toList->length();
if (!toListSize)
return false;
// If the 'from' value is given and it's length doesn't match the 'to' value list length, fallback to a discrete animation.
- size_t fromListSize = fromList->numberOfItems();
+ size_t fromListSize = fromList->length();
if (fromListSize != toListSize && fromListSize) {
if (percentage < 0.5) {
if (!isToAnimation)
@@ -167,8 +167,8 @@ bool SVGPointList::adjustFromToListValues(PassRefPtr<SVGPointList> passFromList,
}
ASSERT(!fromListSize || fromListSize == toListSize);
- if (resizeAnimatedListIfNeeded && numberOfItems() < toListSize) {
- size_t paddingCount = toListSize - numberOfItems();
+ if (resizeAnimatedListIfNeeded && length() < toListSize) {
+ size_t paddingCount = toListSize - length();
for (size_t i = 0; i < paddingCount; ++i)
append(SVGPoint::create());
}
@@ -182,9 +182,9 @@ void SVGPointList::calculateAnimatedValue(SVGAnimationElement* animationElement,
RefPtr<SVGPointList> toList = toSVGPointList(toValue);
RefPtr<SVGPointList> toAtEndOfDurationList = toSVGPointList(toAtEndOfDurationValue);
- size_t fromPointListSize = fromList->numberOfItems();
- size_t toPointListSize = toList->numberOfItems();
- size_t toAtEndOfDurationListSize = toAtEndOfDurationList->numberOfItems();
+ size_t fromPointListSize = fromList->length();
+ size_t toPointListSize = toList->length();
+ size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length();
if (!adjustFromToListValues(fromList, toList, percentage, animationElement->animationMode() == ToAnimation, true))
return;
« no previous file with comments | « Source/core/svg/SVGPathSegList.idl ('k') | Source/core/svg/SVGPointList.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698