| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 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/SVGAnimateTransformElement.h" | 34 #include "core/svg/SVGAnimateTransformElement.h" |
| 35 #include "core/svg/SVGAnimatedColor.h" | 35 #include "core/svg/SVGAnimatedColor.h" |
| 36 #include "core/svg/SVGAnimationElement.h" | 36 #include "core/svg/SVGAnimationElement.h" |
| 37 #include "core/svg/SVGColor.h" | |
| 38 #include "core/svg/SVGElementInstance.h" | 37 #include "core/svg/SVGElementInstance.h" |
| 39 #include "core/svg/SVGLength.h" | 38 #include "core/svg/SVGLength.h" |
| 40 #include "core/svg/SVGLengthList.h" | 39 #include "core/svg/SVGLengthList.h" |
| 41 #include "core/svg/SVGNumber.h" | 40 #include "core/svg/SVGNumber.h" |
| 41 #include "core/svg/SVGPaint.h" |
| 42 #include "core/svg/SVGPointList.h" | 42 #include "core/svg/SVGPointList.h" |
| 43 #include "core/svg/SVGString.h" | 43 #include "core/svg/SVGString.h" |
| 44 #include "core/svg/SVGTransformList.h" | 44 #include "core/svg/SVGTransformList.h" |
| 45 | 45 |
| 46 namespace WebCore { | 46 namespace WebCore { |
| 47 | 47 |
| 48 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT
ype type, SVGAnimationElement* animationElement, SVGElement* contextElement) | 48 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT
ype type, SVGAnimationElement* animationElement, SVGElement* contextElement) |
| 49 : SVGAnimatedTypeAnimator(type, animationElement, contextElement) | 49 : SVGAnimatedTypeAnimator(type, animationElement, contextElement) |
| 50 { | 50 { |
| 51 ASSERT(m_animationElement); | 51 ASSERT(m_animationElement); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 ASSERT(isAnimatingCSSProperty()); | 82 ASSERT(isAnimatingCSSProperty()); |
| 83 | 83 |
| 84 // CSS properties animation code-path. | 84 // CSS properties animation code-path. |
| 85 // Create a basic instance of the corresponding SVG property. | 85 // Create a basic instance of the corresponding SVG property. |
| 86 // The instance will not have full context info. (e.g. SVGLengthMode) | 86 // The instance will not have full context info. (e.g. SVGLengthMode) |
| 87 | 87 |
| 88 switch (m_type) { | 88 switch (m_type) { |
| 89 case AnimatedColor: | 89 case AnimatedColor: |
| 90 return SVGColorProperty::create(value.isEmpty() ? StyleColor::currentCol
or() : SVGColor::colorFromRGBColorString(value)); | 90 return SVGColorProperty::create(value.isEmpty() ? StyleColor::currentCol
or() : SVGPaint::colorFromRGBColorString(value)); |
| 91 case AnimatedNumber: { | 91 case AnimatedNumber: { |
| 92 RefPtr<SVGNumber> property = SVGNumber::create(); | 92 RefPtr<SVGNumber> property = SVGNumber::create(); |
| 93 property->setValueAsString(value, IGNORE_EXCEPTION); | 93 property->setValueAsString(value, IGNORE_EXCEPTION); |
| 94 return property.release(); | 94 return property.release(); |
| 95 } | 95 } |
| 96 case AnimatedLength: { | 96 case AnimatedLength: { |
| 97 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther); | 97 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther); |
| 98 property->setValueAsString(value, IGNORE_EXCEPTION); | 98 property->setValueAsString(value, IGNORE_EXCEPTION); |
| 99 return property.release(); | 99 return property.release(); |
| 100 } | 100 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString
, const String& toString) | 261 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString
, const String& toString) |
| 262 { | 262 { |
| 263 ASSERT(m_animationElement); | 263 ASSERT(m_animationElement); |
| 264 ASSERT(m_contextElement); | 264 ASSERT(m_contextElement); |
| 265 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString
); | 265 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString
); |
| 266 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); | 266 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); |
| 267 return fromValue->calculateDistance(toValue, m_contextElement); | 267 return fromValue->calculateDistance(toValue, m_contextElement); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace WebCore | 270 } // namespace WebCore |
| OLD | NEW |