OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 AnimatedPropertyType SVGAnimateElement::animatedPropertyType() { | 159 AnimatedPropertyType SVGAnimateElement::animatedPropertyType() { |
160 if (!targetElement()) | 160 if (!targetElement()) |
161 return AnimatedUnknown; | 161 return AnimatedUnknown; |
162 resolveTargetProperty(); | 162 resolveTargetProperty(); |
163 return m_type; | 163 return m_type; |
164 } | 164 } |
165 | 165 |
166 bool SVGAnimateElement::hasValidTarget() { | 166 bool SVGAnimateElement::hasValidTarget() { |
167 return SVGAnimationElement::hasValidTarget() && hasValidAttributeName() && | 167 if (!SVGAnimationElement::hasValidTarget()) |
168 hasValidAttributeType(); | 168 return false; |
| 169 if (!hasValidAttributeName()) |
| 170 return false; |
| 171 resolveTargetProperty(); |
| 172 return m_type != AnimatedUnknown && !m_hasInvalidCSSAttributeType; |
169 } | 173 } |
170 | 174 |
171 bool SVGAnimateElement::hasValidAttributeName() const { | 175 bool SVGAnimateElement::hasValidAttributeName() const { |
172 return attributeName() != anyQName(); | 176 return attributeName() != anyQName(); |
173 } | 177 } |
174 | 178 |
175 bool SVGAnimateElement::hasValidAttributeType() { | |
176 if (!targetElement()) | |
177 return false; | |
178 return animatedPropertyType() != AnimatedUnknown && | |
179 !hasInvalidCSSAttributeType(); | |
180 } | |
181 | |
182 bool SVGAnimateElement::shouldApplyAnimation( | 179 bool SVGAnimateElement::shouldApplyAnimation( |
183 const SVGElement& targetElement, | 180 const SVGElement& targetElement, |
184 const QualifiedName& attributeName) { | 181 const QualifiedName& attributeName) { |
185 if (!hasValidTarget() || !targetElement.parentNode()) | 182 if (!hasValidTarget() || !targetElement.parentNode()) |
186 return false; | 183 return false; |
187 | 184 |
188 // Always animate CSS properties using the ApplyCSSAnimation code path, | 185 // Always animate CSS properties using the ApplyCSSAnimation code path, |
189 // regardless of the attributeType value. | 186 // regardless of the attributeType value. |
190 if (isTargetAttributeCSSProperty(targetElement, attributeName)) | 187 if (isTargetAttributeCSSProperty(targetElement, attributeName)) |
191 return true; | 188 return true; |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 DEFINE_TRACE(SVGAnimateElement) { | 563 DEFINE_TRACE(SVGAnimateElement) { |
567 visitor->trace(m_fromProperty); | 564 visitor->trace(m_fromProperty); |
568 visitor->trace(m_toProperty); | 565 visitor->trace(m_toProperty); |
569 visitor->trace(m_toAtEndOfDurationProperty); | 566 visitor->trace(m_toAtEndOfDurationProperty); |
570 visitor->trace(m_animatedValue); | 567 visitor->trace(m_animatedValue); |
571 visitor->trace(m_targetProperty); | 568 visitor->trace(m_targetProperty); |
572 SVGAnimationElement::trace(visitor); | 569 SVGAnimationElement::trace(visitor); |
573 } | 570 } |
574 | 571 |
575 } // namespace blink | 572 } // namespace blink |
OLD | NEW |