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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPro pertyID id) 220 static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPro pertyID id)
221 { 221 {
222 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id); 222 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
223 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation)); 223 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation));
224 } 224 }
225 225
226 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString) 226 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString)
227 { 227 {
228 ASSERT(targetElement); 228 ASSERT(targetElement);
229 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode()) 229 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode())
230 return; 230 return;
231 231
232 CSSPropertyID id = cssPropertyID(attributeName.localName()); 232 CSSPropertyID id = cssPropertyID(attributeName.localName());
233 233
234 SVGElement::InstanceUpdateBlocker blocker(targetElement); 234 SVGElement::InstanceUpdateBlocker blocker(targetElement);
235 applyCSSPropertyToTarget(targetElement, id, valueAsString); 235 applyCSSPropertyToTarget(targetElement, id, valueAsString);
236 236
237 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 237 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
238 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement(); 238 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement();
239 for (SVGElement* shadowTreeElement : instances) { 239 for (SVGElement* shadowTreeElement : instances) {
240 if (shadowTreeElement) 240 if (shadowTreeElement)
241 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); 241 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
242 } 242 }
243 } 243 }
244 244
245 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle ment, const QualifiedName& attributeName) 245 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle ment, const QualifiedName& attributeName)
246 { 246 {
247 ASSERT(targetElement); 247 ASSERT(targetElement);
248 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode()) 248 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode())
249 return; 249 return;
250 250
251 CSSPropertyID id = cssPropertyID(attributeName.localName()); 251 CSSPropertyID id = cssPropertyID(attributeName.localName());
252 252
253 SVGElement::InstanceUpdateBlocker blocker(targetElement); 253 SVGElement::InstanceUpdateBlocker blocker(targetElement);
254 removeCSSPropertyFromTarget(targetElement, id); 254 removeCSSPropertyFromTarget(targetElement, id);
255 255
256 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 256 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
257 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement(); 257 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement();
258 for (SVGElement* shadowTreeElement : instances) { 258 for (SVGElement* shadowTreeElement : instances) {
259 if (shadowTreeElement) 259 if (shadowTreeElement)
260 removeCSSPropertyFromTarget(shadowTreeElement, id); 260 removeCSSPropertyFromTarget(shadowTreeElement, id);
261 } 261 }
262 } 262 }
263 263
264 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName) 264 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName)
265 { 265 {
266 targetElement->invalidateSVGAttributes(); 266 targetElement->invalidateSVGAttributes();
267 targetElement->svgAttributeChanged(attributeName); 267 targetElement->svgAttributeChanged(attributeName);
268 } 268 }
269 269
270 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName) 270 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName)
271 { 271 {
272 ASSERT(targetElement); 272 ASSERT(targetElement);
273 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode()) 273 if (attributeName == anyQName() || !targetElement->isConnected() || !targetE lement->parentNode())
274 return; 274 return;
275 275
276 SVGElement::InstanceUpdateBlocker blocker(targetElement); 276 SVGElement::InstanceUpdateBlocker blocker(targetElement);
277 notifyTargetAboutAnimValChange(targetElement, attributeName); 277 notifyTargetAboutAnimValChange(targetElement, attributeName);
278 278
279 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 279 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
280 for (SVGElement* element : targetElement->instancesForElement()) 280 for (SVGElement* element : targetElement->instancesForElement())
281 notifyTargetAboutAnimValChange(element, attributeName); 281 notifyTargetAboutAnimValChange(element, attributeName);
282 } 282 }
283 283
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 { 405 {
406 visitor->trace(m_fromProperty); 406 visitor->trace(m_fromProperty);
407 visitor->trace(m_toProperty); 407 visitor->trace(m_toProperty);
408 visitor->trace(m_toAtEndOfDurationProperty); 408 visitor->trace(m_toAtEndOfDurationProperty);
409 visitor->trace(m_animatedProperty); 409 visitor->trace(m_animatedProperty);
410 visitor->trace(m_animator); 410 visitor->trace(m_animator);
411 SVGAnimationElement::trace(visitor); 411 SVGAnimationElement::trace(visitor);
412 } 412 }
413 413
414 } // namespace blink 414 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698