OLD | NEW |
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen
t, const QualifiedName& attributeName, const String& valueAsString) | 222 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen
t, const QualifiedName& attributeName, const String& valueAsString) |
223 { | 223 { |
224 ASSERT(targetElement); | 224 ASSERT(targetElement); |
225 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 225 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
226 return; | 226 return; |
227 | 227 |
228 CSSPropertyID id = cssPropertyID(attributeName.localName()); | 228 CSSPropertyID id = cssPropertyID(attributeName.localName()); |
229 | 229 |
230 SVGElementInstance::InstanceUpdateBlocker blocker(targetElement); | 230 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
231 applyCSSPropertyToTarget(targetElement, id, valueAsString); | 231 applyCSSPropertyToTarget(targetElement, id, valueAsString); |
232 | 232 |
233 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 233 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
234 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 234 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; |
235 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 235 const HashSet<SVGElement*>::const_iterator end = instances.end(); |
236 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 236 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { |
237 if (SVGElement* shadowTreeElement = *it) | 237 if (SVGElement* shadowTreeElement = *it) |
238 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); | 238 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle
ment, const QualifiedName& attributeName) | 242 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle
ment, const QualifiedName& attributeName) |
243 { | 243 { |
244 ASSERT(targetElement); | 244 ASSERT(targetElement); |
245 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 245 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
246 return; | 246 return; |
247 | 247 |
248 CSSPropertyID id = cssPropertyID(attributeName.localName()); | 248 CSSPropertyID id = cssPropertyID(attributeName.localName()); |
249 | 249 |
250 SVGElementInstance::InstanceUpdateBlocker blocker(targetElement); | 250 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
251 removeCSSPropertyFromTarget(targetElement, id); | 251 removeCSSPropertyFromTarget(targetElement, id); |
252 | 252 |
253 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 253 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
254 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 254 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; |
255 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 255 const HashSet<SVGElement*>::const_iterator end = instances.end(); |
256 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 256 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { |
257 if (SVGElement* shadowTreeElement = *it) | 257 if (SVGElement* shadowTreeElement = *it) |
258 removeCSSPropertyFromTarget(shadowTreeElement, id); | 258 removeCSSPropertyFromTarget(shadowTreeElement, id); |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
262 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con
st QualifiedName& attributeName) | 262 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con
st QualifiedName& attributeName) |
263 { | 263 { |
264 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); | 264 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); |
265 targetElement->invalidateSVGAttributes(); | 265 targetElement->invalidateSVGAttributes(); |
266 targetElement->svgAttributeChanged(attributeName); | 266 targetElement->svgAttributeChanged(attributeName); |
267 } | 267 } |
268 | 268 |
269 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target
Element, const QualifiedName& attributeName) | 269 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target
Element, const QualifiedName& attributeName) |
270 { | 270 { |
271 ASSERT(targetElement); | 271 ASSERT(targetElement); |
272 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 272 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
273 return; | 273 return; |
274 | 274 |
275 SVGElementInstance::InstanceUpdateBlocker blocker(targetElement); | 275 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
276 notifyTargetAboutAnimValChange(targetElement, attributeName); | 276 notifyTargetAboutAnimValChange(targetElement, attributeName); |
277 | 277 |
278 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 278 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
279 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 279 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; |
280 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 280 const HashSet<SVGElement*>::const_iterator end = instances.end(); |
281 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 281 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { |
282 if (SVGElement* shadowTreeElement = *it) | 282 if (SVGElement* shadowTreeElement = *it) |
283 notifyTargetAboutAnimValChange(shadowTreeElement, attributeName); | 283 notifyTargetAboutAnimValChange(shadowTreeElement, attributeName); |
284 } | 284 } |
285 } | 285 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() | 393 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() |
394 { | 394 { |
395 if (!m_animator) | 395 if (!m_animator) |
396 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi
s, targetElement()); | 396 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi
s, targetElement()); |
397 ASSERT(m_animatedPropertyType == m_animator->type()); | 397 ASSERT(m_animatedPropertyType == m_animator->type()); |
398 return m_animator.get(); | 398 return m_animator.get(); |
399 } | 399 } |
400 | 400 |
401 } | 401 } |
OLD | NEW |