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

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

Issue 2292983002: Don't add redundant references to animated target element (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 SVGElement* targetElement = this->targetElement(); 175 SVGElement* targetElement = this->targetElement();
176 const QualifiedName& attributeName = this->attributeName(); 176 const QualifiedName& attributeName = this->attributeName();
177 177
178 m_animator.reset(targetElement); 178 m_animator.reset(targetElement);
179 179
180 ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement, a ttributeName); 180 ShouldApplyAnimationType shouldApply = shouldApplyAnimation(targetElement, a ttributeName);
181 if (shouldApply == DontApplyAnimation) 181 if (shouldApply == DontApplyAnimation)
182 return; 182 return;
183 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimati on) { 183 if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimati on) {
184 // SVG DOM animVal animation code-path. 184 // SVG DOM animVal animation code-path.
185 SVGElementInstances animatedElements = findElementInstances(targetElemen t);
186 ASSERT(!animatedElements.isEmpty());
187
188 for (SVGElement* element : animatedElements)
189 addReferenceTo(element);
190
191 m_animatedProperty = m_animator.createAnimatedValue(); 185 m_animatedProperty = m_animator.createAnimatedValue();
192 targetElement->setAnimatedAttribute(attributeName, m_animatedProperty); 186 targetElement->setAnimatedAttribute(attributeName, m_animatedProperty);
193 return; 187 return;
194 } 188 }
195 DCHECK_EQ(shouldApply, ApplyCSSAnimation); 189 DCHECK_EQ(shouldApply, ApplyCSSAnimation);
196 190
197 // CSS properties animation code-path. 191 // CSS properties animation code-path.
198 String baseValue; 192 String baseValue;
199 DCHECK(isTargetAttributeCSSProperty(targetElement, attributeName)); 193 DCHECK(isTargetAttributeCSSProperty(targetElement, attributeName));
200 computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName ()), baseValue); 194 computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName ()), baseValue);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 { 321 {
328 visitor->trace(m_fromProperty); 322 visitor->trace(m_fromProperty);
329 visitor->trace(m_toProperty); 323 visitor->trace(m_toProperty);
330 visitor->trace(m_toAtEndOfDurationProperty); 324 visitor->trace(m_toAtEndOfDurationProperty);
331 visitor->trace(m_animatedProperty); 325 visitor->trace(m_animatedProperty);
332 visitor->trace(m_animator); 326 visitor->trace(m_animator);
333 SVGAnimationElement::trace(visitor); 327 SVGAnimationElement::trace(visitor);
334 } 328 }
335 329
336 } // namespace blink 330 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698