Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Source/core/svg/SVGAnimateElement.cpp

Issue 21095003: Early return if animations should not apply in resetAnimatedType() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/animations/attributeNameAndAttributeTypeMismatch-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 #endif 198 #endif
199 199
200 void SVGAnimateElement::resetAnimatedType() 200 void SVGAnimateElement::resetAnimatedType()
201 { 201 {
202 SVGAnimatedTypeAnimator* animator = ensureAnimator(); 202 SVGAnimatedTypeAnimator* animator = ensureAnimator();
203 ASSERT(m_animatedPropertyType == animator->type()); 203 ASSERT(m_animatedPropertyType == animator->type());
204 204
205 SVGElement* targetElement = this->targetElement(); 205 SVGElement* targetElement = this->targetElement();
206 const QualifiedName& attributeName = this->attributeName(); 206 const QualifiedName& attributeName = this->attributeName();
207 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attri buteName); 207 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attri buteName);
208
209 if (shouldApply == DontApplyAnimation)
210 return;
211
208 if (shouldApply == ApplyXMLAnimation) { 212 if (shouldApply == ApplyXMLAnimation) {
209 // SVG DOM animVal animation code-path. 213 // SVG DOM animVal animation code-path.
210 m_animatedProperties = animator->findAnimatedPropertiesForAttributeName( targetElement, attributeName); 214 m_animatedProperties = animator->findAnimatedPropertiesForAttributeName( targetElement, attributeName);
211 ASSERT(!m_animatedProperties.isEmpty()); 215 ASSERT(!m_animatedProperties.isEmpty());
212 216
213 ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProp erties)); 217 ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProp erties));
214 if (!m_animatedType) 218 if (!m_animatedType)
215 m_animatedType = animator->startAnimValAnimation(m_animatedPropertie s); 219 m_animatedType = animator->startAnimValAnimation(m_animatedPropertie s);
216 else { 220 else {
217 animator->resetAnimValToBaseVal(m_animatedProperties, m_animatedType .get()); 221 animator->resetAnimValToBaseVal(m_animatedProperties, m_animatedType .get());
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 425
422 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() 426 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
423 { 427 {
424 if (!m_animator) 428 if (!m_animator)
425 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animate dPropertyType); 429 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animate dPropertyType);
426 ASSERT(m_animatedPropertyType == m_animator->type()); 430 ASSERT(m_animatedPropertyType == m_animator->type());
427 return m_animator.get(); 431 return m_animator.get();
428 } 432 }
429 433
430 } 434 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/animations/attributeNameAndAttributeTypeMismatch-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698