Chromium Code Reviews| 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 17 matching lines...) Expand all Loading... | |
| 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/SVGAnimationElement.h" | 34 #include "core/svg/SVGAnimationElement.h" |
| 35 #include "core/svg/SVGElementInstance.h" | 35 #include "core/svg/SVGElementInstance.h" |
| 36 #include "core/svg/SVGLength.h" | 36 #include "core/svg/SVGLength.h" |
| 37 #include "core/svg/SVGLengthList.h" | 37 #include "core/svg/SVGLengthList.h" |
| 38 #include "core/svg/SVGPointList.h" | |
| 38 | 39 |
| 39 namespace WebCore { | 40 namespace WebCore { |
| 40 | 41 |
| 41 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT ype type, SVGAnimationElement* animationElement, SVGElement* contextElement) | 42 SVGAnimatedNewPropertyAnimator::SVGAnimatedNewPropertyAnimator(AnimatedPropertyT ype type, SVGAnimationElement* animationElement, SVGElement* contextElement) |
| 42 : SVGAnimatedTypeAnimator(type, animationElement, contextElement) | 43 : SVGAnimatedTypeAnimator(type, animationElement, contextElement) |
| 43 { | 44 { |
| 44 ASSERT(m_animationElement); | 45 ASSERT(m_animationElement); |
| 45 ASSERT(m_contextElement); | 46 ASSERT(m_contextElement); |
| 46 | 47 |
| 47 const QualifiedName& attributeName = m_animationElement->attributeName(); | 48 const QualifiedName& attributeName = m_animationElement->attributeName(); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 74 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther); | 75 RefPtr<SVGLength> property = SVGLength::create(LengthModeOther); |
| 75 property->setValueAsString(value, IGNORE_EXCEPTION); | 76 property->setValueAsString(value, IGNORE_EXCEPTION); |
| 76 return property.release(); | 77 return property.release(); |
| 77 } | 78 } |
| 78 case AnimatedLengthList: { | 79 case AnimatedLengthList: { |
| 79 RefPtr<SVGLengthList> property = SVGLengthList::create(LengthModeOther); | 80 RefPtr<SVGLengthList> property = SVGLengthList::create(LengthModeOther); |
| 80 property->setValueAsString(value, IGNORE_EXCEPTION); | 81 property->setValueAsString(value, IGNORE_EXCEPTION); |
| 81 return property.release(); | 82 return property.release(); |
| 82 } | 83 } |
| 83 | 84 |
| 85 // These types don't appear in the table in SVGElement::cssPropertyToTypeMap () and thus don't need support. | |
| 86 case AnimatedBoolean: | |
| 87 case AnimatedRect: | |
|
haraken
2014/01/17 11:50:18
Alphabetical order please.
kouhei (in TOK)
2014/01/20 01:10:26
Done.
| |
| 88 case AnimatedPoint: | |
| 89 case AnimatedPoints: | |
| 90 ASSERT_NOT_REACHED(); | |
| 91 | |
| 84 // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818 | 92 // These properties are not yet migrated to NewProperty implementation. see http://crbug.com/308818 |
| 85 case AnimatedAngle: | 93 case AnimatedAngle: |
| 86 case AnimatedBoolean: | |
| 87 case AnimatedColor: | 94 case AnimatedColor: |
| 88 case AnimatedEnumeration: | 95 case AnimatedEnumeration: |
| 89 case AnimatedInteger: | 96 case AnimatedInteger: |
| 90 case AnimatedIntegerOptionalInteger: | 97 case AnimatedIntegerOptionalInteger: |
| 91 case AnimatedNumber: | 98 case AnimatedNumber: |
| 92 case AnimatedNumberList: | 99 case AnimatedNumberList: |
| 93 case AnimatedNumberOptionalNumber: | 100 case AnimatedNumberOptionalNumber: |
| 94 case AnimatedPath: | 101 case AnimatedPath: |
| 95 case AnimatedPoints: | |
| 96 case AnimatedPreserveAspectRatio: | 102 case AnimatedPreserveAspectRatio: |
| 97 case AnimatedRect: | |
| 98 case AnimatedString: | 103 case AnimatedString: |
| 99 case AnimatedTransformList: | 104 case AnimatedTransformList: |
| 100 ASSERT_NOT_REACHED(); | 105 ASSERT_NOT_REACHED(); |
| 101 | 106 |
| 102 case AnimatedUnknown: | 107 case AnimatedUnknown: |
| 103 ASSERT_NOT_REACHED(); | 108 ASSERT_NOT_REACHED(); |
| 104 }; | 109 }; |
| 105 | 110 |
| 106 ASSERT_NOT_REACHED(); | 111 ASSERT_NOT_REACHED(); |
| 107 return 0; | 112 return 0; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString) | 238 float SVGAnimatedNewPropertyAnimator::calculateDistance(const String& fromString , const String& toString) |
| 234 { | 239 { |
| 235 ASSERT(m_animationElement); | 240 ASSERT(m_animationElement); |
| 236 ASSERT(m_contextElement); | 241 ASSERT(m_contextElement); |
| 237 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString ); | 242 RefPtr<NewSVGPropertyBase> fromValue = createPropertyForAnimation(fromString ); |
| 238 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); | 243 RefPtr<NewSVGPropertyBase> toValue = createPropertyForAnimation(toString); |
| 239 return fromValue->calculateDistance(toValue, m_contextElement); | 244 return fromValue->calculateDistance(toValue, m_contextElement); |
| 240 } | 245 } |
| 241 | 246 |
| 242 } // namespace WebCore | 247 } // namespace WebCore |
| OLD | NEW |