| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ASSERT_NOT_REACHED(); | 136 ASSERT_NOT_REACHED(); |
| 137 | 137 |
| 138 case AnimatedUnknown: | 138 case AnimatedUnknown: |
| 139 ASSERT_NOT_REACHED(); | 139 ASSERT_NOT_REACHED(); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 ASSERT_NOT_REACHED(); | 142 ASSERT_NOT_REACHED(); |
| 143 return nullptr; | 143 return nullptr; |
| 144 } | 144 } |
| 145 | 145 |
| 146 SVGPropertyBase* SVGAnimatedTypeAnimator::constructFromString(const String& valu
e) | 146 SVGPropertyBase* SVGAnimatedTypeAnimator::createAnimatedValueFromString(const St
ring& value) |
| 147 { | 147 { |
| 148 return createPropertyForAnimation(value); | 148 return createPropertyForAnimation(value); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void SVGAnimatedTypeAnimator::calculateFromAndToValues(Member<SVGPropertyBase>&
from, Member<SVGPropertyBase>& to, const String& fromString, const String& toStr
ing) | 151 void SVGAnimatedTypeAnimator::calculateFromAndToValues(Member<SVGPropertyBase>&
from, Member<SVGPropertyBase>& to, const String& fromString, const String& toStr
ing) |
| 152 { | 152 { |
| 153 from = constructFromString(fromString); | 153 from = createAnimatedValueFromString(fromString); |
| 154 to = constructFromString(toString); | 154 to = createAnimatedValueFromString(toString); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void SVGAnimatedTypeAnimator::calculateFromAndByValues(Member<SVGPropertyBase>&
from, Member<SVGPropertyBase>& to, const String& fromString, const String& byStr
ing) | 157 void SVGAnimatedTypeAnimator::calculateFromAndByValues(Member<SVGPropertyBase>&
from, Member<SVGPropertyBase>& to, const String& fromString, const String& byStr
ing) |
| 158 { | 158 { |
| 159 from = constructFromString(fromString); | 159 from = createAnimatedValueFromString(fromString); |
| 160 to = constructFromString(byString); | 160 to = createAnimatedValueFromString(byString); |
| 161 to->add(from, m_contextElement); | 161 to->add(from, m_contextElement); |
| 162 } | 162 } |
| 163 | 163 |
| 164 SVGPropertyBase* SVGAnimatedTypeAnimator::resetAnimation() | 164 SVGPropertyBase* SVGAnimatedTypeAnimator::createAnimatedValue() |
| 165 { | 165 { |
| 166 DCHECK(isAnimatingSVGDom()); | 166 DCHECK(isAnimatingSVGDom()); |
| 167 DCHECK(m_contextElement); | |
| 168 SVGPropertyBase* animatedValue = m_animatedProperty->createAnimatedValue(); | 167 SVGPropertyBase* animatedValue = m_animatedProperty->createAnimatedValue(); |
| 169 DCHECK_EQ(animatedValue->type(), m_type); | 168 DCHECK_EQ(animatedValue->type(), m_type); |
| 170 m_contextElement->setAnimatedAttribute(m_animatedProperty->attributeName(),
animatedValue); | |
| 171 return animatedValue; | 169 return animatedValue; |
| 172 } | 170 } |
| 173 | 171 |
| 174 SVGPropertyBase* SVGAnimatedTypeAnimator::startAnimValAnimation() | |
| 175 { | |
| 176 return resetAnimation(); | |
| 177 } | |
| 178 | |
| 179 void SVGAnimatedTypeAnimator::stopAnimValAnimation() | |
| 180 { | |
| 181 if (!isAnimatingSVGDom()) | |
| 182 return; | |
| 183 DCHECK(m_contextElement); | |
| 184 m_contextElement->clearAnimatedAttribute(m_animatedProperty->attributeName()
); | |
| 185 } | |
| 186 | |
| 187 SVGPropertyBase* SVGAnimatedTypeAnimator::resetAnimValToBaseVal() | |
| 188 { | |
| 189 return resetAnimation(); | |
| 190 } | |
| 191 | |
| 192 class ParsePropertyFromString { | 172 class ParsePropertyFromString { |
| 193 STACK_ALLOCATED(); | 173 STACK_ALLOCATED(); |
| 194 public: | 174 public: |
| 195 explicit ParsePropertyFromString(SVGAnimatedTypeAnimator* animator) | 175 explicit ParsePropertyFromString(SVGAnimatedTypeAnimator* animator) |
| 196 : m_animator(animator) | 176 : m_animator(animator) |
| 197 { | 177 { |
| 198 } | 178 } |
| 199 | 179 |
| 200 SVGPropertyBase* operator()(SVGAnimationElement*, const String& value) | 180 SVGPropertyBase* operator()(SVGAnimationElement*, const String& value) |
| 201 { | 181 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 213 } |
| 234 | 214 |
| 235 DEFINE_TRACE(SVGAnimatedTypeAnimator) | 215 DEFINE_TRACE(SVGAnimatedTypeAnimator) |
| 236 { | 216 { |
| 237 visitor->trace(m_animationElement); | 217 visitor->trace(m_animationElement); |
| 238 visitor->trace(m_contextElement); | 218 visitor->trace(m_contextElement); |
| 239 visitor->trace(m_animatedProperty); | 219 visitor->trace(m_animatedProperty); |
| 240 } | 220 } |
| 241 | 221 |
| 242 } // namespace blink | 222 } // namespace blink |
| OLD | NEW |