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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 #if !ENABLE(OILPAN) 226 #if !ENABLE(OILPAN)
227 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); 227 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun);
228 #endif 228 #endif
229 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id); 229 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id);
230 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation)); 230 targetElement->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTra cing::create(StyleChangeReason::Animation));
231 } 231 }
232 232
233 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString) 233 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString)
234 { 234 {
235 ASSERT(targetElement); 235 ASSERT(targetElement);
236 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) 236 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode())
237 return; 237 return;
238 238
239 CSSPropertyID id = cssPropertyID(attributeName.localName()); 239 CSSPropertyID id = cssPropertyID(attributeName.localName());
240 240
241 SVGElement::InstanceUpdateBlocker blocker(targetElement); 241 SVGElement::InstanceUpdateBlocker blocker(targetElement);
242 applyCSSPropertyToTarget(targetElement, id, valueAsString); 242 applyCSSPropertyToTarget(targetElement, id, valueAsString);
243 243
244 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 244 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
245 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement(); 245 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement();
246 for (SVGElement* shadowTreeElement : instances) { 246 for (SVGElement* shadowTreeElement : instances) {
247 if (shadowTreeElement) 247 if (shadowTreeElement)
248 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); 248 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
249 } 249 }
250 } 250 }
251 251
252 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle ment, const QualifiedName& attributeName) 252 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle ment, const QualifiedName& attributeName)
253 { 253 {
254 ASSERT(targetElement); 254 ASSERT(targetElement);
255 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) 255 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode())
256 return; 256 return;
257 257
258 CSSPropertyID id = cssPropertyID(attributeName.localName()); 258 CSSPropertyID id = cssPropertyID(attributeName.localName());
259 259
260 SVGElement::InstanceUpdateBlocker blocker(targetElement); 260 SVGElement::InstanceUpdateBlocker blocker(targetElement);
261 removeCSSPropertyFromTarget(targetElement, id); 261 removeCSSPropertyFromTarget(targetElement, id);
262 262
263 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 263 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
264 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement(); 264 const HeapHashSet<WeakMember<SVGElement>>& instances = targetElement->instan cesForElement();
265 for (SVGElement* shadowTreeElement : instances) { 265 for (SVGElement* shadowTreeElement : instances) {
266 if (shadowTreeElement) 266 if (shadowTreeElement)
267 removeCSSPropertyFromTarget(shadowTreeElement, id); 267 removeCSSPropertyFromTarget(shadowTreeElement, id);
268 } 268 }
269 } 269 }
270 270
271 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName) 271 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName)
272 { 272 {
273 #if !ENABLE(OILPAN) 273 #if !ENABLE(OILPAN)
274 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); 274 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun);
275 #endif 275 #endif
276 targetElement->invalidateSVGAttributes(); 276 targetElement->invalidateSVGAttributes();
277 targetElement->svgAttributeChanged(attributeName); 277 targetElement->svgAttributeChanged(attributeName);
278 } 278 }
279 279
280 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName) 280 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName)
281 { 281 {
282 ASSERT(targetElement); 282 ASSERT(targetElement);
283 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) 283 if (attributeName == anyQName() || !targetElement->inShadowIncludingDocument () || !targetElement->parentNode())
284 return; 284 return;
285 285
286 SVGElement::InstanceUpdateBlocker blocker(targetElement); 286 SVGElement::InstanceUpdateBlocker blocker(targetElement);
287 notifyTargetAboutAnimValChange(targetElement, attributeName); 287 notifyTargetAboutAnimValChange(targetElement, attributeName);
288 288
289 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt. 289 // If the target element has instances, update them as well, w/o requiring t he <use> tree to be rebuilt.
290 for (SVGElement* element : targetElement->instancesForElement()) 290 for (SVGElement* element : targetElement->instancesForElement())
291 notifyTargetAboutAnimValChange(element, attributeName); 291 notifyTargetAboutAnimValChange(element, attributeName);
292 } 292 }
293 293
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 { 410 {
411 visitor->trace(m_fromProperty); 411 visitor->trace(m_fromProperty);
412 visitor->trace(m_toProperty); 412 visitor->trace(m_toProperty);
413 visitor->trace(m_toAtEndOfDurationProperty); 413 visitor->trace(m_toAtEndOfDurationProperty);
414 visitor->trace(m_animatedProperty); 414 visitor->trace(m_animatedProperty);
415 visitor->trace(m_animator); 415 visitor->trace(m_animator);
416 SVGAnimationElement::trace(visitor); 416 SVGAnimationElement::trace(visitor);
417 } 417 }
418 418
419 } // namespace blink 419 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698