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

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

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove debug print Created 6 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/SVGAnimateElement.h ('k') | Source/core/svg/SVGAnimatedString.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "core/svg/SVGAnimatedNewPropertyAnimator.h" 32 #include "core/svg/SVGAnimatedNewPropertyAnimator.h"
33 33
34 #include "core/svg/SVGAnimatedColor.h" 34 #include "core/svg/SVGAnimatedColor.h"
35 #include "core/svg/SVGAnimationElement.h" 35 #include "core/svg/SVGAnimationElement.h"
36 #include "core/svg/SVGElementInstance.h" 36 #include "core/svg/SVGElementInstance.h"
37 #include "core/svg/SVGLength.h" 37 #include "core/svg/SVGLength.h"
38 #include "core/svg/SVGLengthList.h" 38 #include "core/svg/SVGLengthList.h"
39 #include "core/svg/SVGNumber.h" 39 #include "core/svg/SVGNumber.h"
40 #include "core/svg/SVGPointList.h" 40 #include "core/svg/SVGPointList.h"
41 #include "core/svg/SVGString.h"
41 42
42 namespace WebCore { 43 namespace WebCore {
43 44
44 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT ype type, SVGAnimationElement* animationElement, SVGElement* contextElement) 45 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT ype type, SVGAnimationElement* animationElement, SVGElement* contextElement)
45 : SVGAnimatedTypeAnimator(type, animationElement, contextElement) 46 : SVGAnimatedTypeAnimator(type, animationElement, contextElement)
46 { 47 {
47 ASSERT(m_animationElement); 48 ASSERT(m_animationElement);
48 ASSERT(m_contextElement); 49 ASSERT(m_contextElement);
49 50
50 const QualifiedName& attributeName = m_animationElement->attributeName(); 51 const QualifiedName& attributeName = m_animationElement->attributeName();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 case AnimatedLength: { 84 case AnimatedLength: {
84 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther); 85 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther);
85 property->setValueAsString(value, IGNORE_EXCEPTION); 86 property->setValueAsString(value, IGNORE_EXCEPTION);
86 return property.release(); 87 return property.release();
87 } 88 }
88 case AnimatedLengthList: { 89 case AnimatedLengthList: {
89 RefPtr<SVGLengthList> property = SVGLengthList::create(LengthModeOther); 90 RefPtr<SVGLengthList> property = SVGLengthList::create(LengthModeOther);
90 property->setValueAsString(value, IGNORE_EXCEPTION); 91 property->setValueAsString(value, IGNORE_EXCEPTION);
91 return property.release(); 92 return property.release();
92 } 93 }
94 case AnimatedString: {
95 RefPtr<SVGString> property = SVGString::create();
96 property->setValueAsString(value, IGNORE_EXCEPTION);
97 return property.release();
98 }
93 99
94 // These types don't appear in the table in SVGElement::cssPropertyToTypeMap () and thus don't need support. 100 // These types don't appear in the table in SVGElement::cssPropertyToTypeMap () and thus don't need support.
95 case AnimatedBoolean: 101 case AnimatedBoolean:
96 case AnimatedNumberList: 102 case AnimatedNumberList:
97 case AnimatedNumberOptionalNumber: 103 case AnimatedNumberOptionalNumber:
98 case AnimatedPoint: 104 case AnimatedPoint:
99 case AnimatedPoints: 105 case AnimatedPoints:
100 case AnimatedRect: 106 case AnimatedRect:
101 ASSERT_NOT_REACHED(); 107 ASSERT_NOT_REACHED();
102 108
103 // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818 109 // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818
104 case AnimatedAngle: 110 case AnimatedAngle:
105 case AnimatedEnumeration: 111 case AnimatedEnumeration:
106 case AnimatedInteger: 112 case AnimatedInteger:
107 case AnimatedIntegerOptionalInteger: 113 case AnimatedIntegerOptionalInteger:
108 case AnimatedPath: 114 case AnimatedPath:
109 case AnimatedPreserveAspectRatio: 115 case AnimatedPreserveAspectRatio:
110 case AnimatedString: 116 case AnimatedStringList:
111 case AnimatedTransformList: 117 case AnimatedTransformList:
112 ASSERT_NOT_REACHED(); 118 ASSERT_NOT_REACHED();
113 119
114 case AnimatedUnknown: 120 case AnimatedUnknown:
115 ASSERT_NOT_REACHED(); 121 ASSERT_NOT_REACHED();
116 }; 122 };
117 123
118 ASSERT_NOT_REACHED(); 124 ASSERT_NOT_REACHED();
119 return 0; 125 return 0;
120 } 126 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString) 251 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString)
246 { 252 {
247 ASSERT(m_animationElement); 253 ASSERT(m_animationElement);
248 ASSERT(m_contextElement); 254 ASSERT(m_contextElement);
249 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString ); 255 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString );
250 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); 256 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString);
251 return fromValue->calculateDistance(toValue, m_contextElement); 257 return fromValue->calculateDistance(toValue, m_contextElement);
252 } 258 }
253 259
254 } // namespace WebCore 260 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimateElement.h ('k') | Source/core/svg/SVGAnimatedString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698