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

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

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 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/SVGAnimatedNewPropertyAnimator.h ('k') | Source/core/svg/SVGAnimatedType.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // SVG DOM animVal animation code-path. 62 // SVG DOM animVal animation code-path.
63 return m_animatedProperty->currentValueBase()->cloneForAnimation(value); 63 return m_animatedProperty->currentValueBase()->cloneForAnimation(value);
64 } 64 }
65 65
66 ASSERT(isAnimatingCSSProperty()); 66 ASSERT(isAnimatingCSSProperty());
67 67
68 // CSS properties animation code-path. 68 // CSS properties animation code-path.
69 // Create a basic instance of the corresponding SVG property. 69 // Create a basic instance of the corresponding SVG property.
70 // The instance will not have full context info. (e.g. SVGLengthMode) 70 // The instance will not have full context info. (e.g. SVGLengthMode)
71 71
72 // FIXME: add impls here for NewSVGProperty migrated property impls. 72 switch (m_type) {
73 // http://crbug.com/308818 73 case AnimatedLength: {
74 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther);
75 property->setValueAsString(value, IGNORE_EXCEPTION);
76 return property.release();
77 }
78 case AnimatedLengthList: {
79 RefPtr<SVGLengthList> property = SVGLengthList::create(LengthModeOther);
80 property->setValueAsString(value, IGNORE_EXCEPTION);
81 return property.release();
82 }
83
84 // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818
85 case AnimatedAngle:
86 case AnimatedBoolean:
87 case AnimatedColor:
88 case AnimatedEnumeration:
89 case AnimatedInteger:
90 case AnimatedIntegerOptionalInteger:
91 case AnimatedNumber:
92 case AnimatedNumberList:
93 case AnimatedNumberOptionalNumber:
94 case AnimatedPath:
95 case AnimatedPoints:
96 case AnimatedPreserveAspectRatio:
97 case AnimatedRect:
98 case AnimatedString:
99 case AnimatedTransformList:
100 ASSERT_NOT_REACHED();
101
102 case AnimatedUnknown:
103 ASSERT_NOT_REACHED();
104 };
74 105
75 ASSERT_NOT_REACHED(); 106 ASSERT_NOT_REACHED();
76 return 0; 107 return 0;
77 } 108 }
78 109
79 PassOwnPtr<SVGAnimatedType> SVGAnimatedNewPropertyAnimator::constructFromString( const String& value) 110 PassOwnPtr<SVGAnimatedType> SVGAnimatedNewPropertyAnimator::constructFromString( const String& value)
80 { 111 {
81 return SVGAnimatedType::createNewProperty(createPropertyForAnimation(value)) ; 112 return SVGAnimatedType::createNewProperty(createPropertyForAnimation(value)) ;
82 } 113 }
83 114
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString) 233 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString)
203 { 234 {
204 ASSERT(m_animationElement); 235 ASSERT(m_animationElement);
205 ASSERT(m_contextElement); 236 ASSERT(m_contextElement);
206 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString ); 237 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString );
207 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); 238 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString);
208 return fromValue->calculateDistance(toValue, m_contextElement); 239 return fromValue->calculateDistance(toValue, m_contextElement);
209 } 240 }
210 241
211 } // namespace WebCore 242 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimatedNewPropertyAnimator.h ('k') | Source/core/svg/SVGAnimatedType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698