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

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

Issue 2281643003: Move animVal invalidation from SVGAnimateElement to SVGElement (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 | third_party/WebKit/Source/core/svg/SVGElement.h » ('j') | 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 { 224 {
225 ASSERT(targetElement); 225 ASSERT(targetElement);
226 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode()) 226 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode())
227 return; 227 return;
228 228
229 CSSPropertyID id = cssPropertyID(attributeName.localName()); 229 CSSPropertyID id = cssPropertyID(attributeName.localName());
230 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id); 230 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
231 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation)); 231 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation));
232 } 232 }
233 233
234 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName)
235 {
236 targetElement->invalidateSVGAttributes();
237 targetElement->svgAttributeChanged(attributeName);
238 }
239
240 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName) 234 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName)
241 { 235 {
242 ASSERT(targetElement); 236 ASSERT(targetElement);
243 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode()) 237 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode())
244 return; 238 return;
245 239
246 SVGElement::InstanceUpdateBlocker blocker(targetElement); 240 targetElement->invalidateAnimatedAttribute(attributeName);
247 notifyTargetAboutAnimValChange(targetElement, attributeName);
248
249 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
250 for (SVGElement* element : targetElement->instancesForElement())
251 notifyTargetAboutAnimValChange(element, attributeName);
252 } 241 }
253 242
254 void SVGAnimateElement::clearAnimatedType() 243 void SVGAnimateElement::clearAnimatedType()
255 { 244 {
256 if (!m_animatedProperty) 245 if (!m_animatedProperty)
257 return; 246 return;
258 247
259 // The animated property lock is held for the "result animation" (see SMILTi meContainer::updateAnimations()) 248 // The animated property lock is held for the "result animation" (see SMILTi meContainer::updateAnimations())
260 // while we're processing an animation group. We will very likely crash late r if we clear the animated type 249 // while we're processing an animation group. We will very likely crash late r if we clear the animated type
261 // while the lock is held. See crbug.com/581546. 250 // while the lock is held. See crbug.com/581546.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 { 363 {
375 visitor->trace(m_fromProperty); 364 visitor->trace(m_fromProperty);
376 visitor->trace(m_toProperty); 365 visitor->trace(m_toProperty);
377 visitor->trace(m_toAtEndOfDurationProperty); 366 visitor->trace(m_toAtEndOfDurationProperty);
378 visitor->trace(m_animatedProperty); 367 visitor->trace(m_animatedProperty);
379 visitor->trace(m_animator); 368 visitor->trace(m_animator);
380 SVGAnimationElement::trace(visitor); 369 SVGAnimationElement::trace(visitor);
381 } 370 }
382 371
383 } // namespace blink 372 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698