OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |