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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 namespace { | 144 namespace { |
145 | 145 |
146 Vector<SVGElement*> findElementInstances(SVGElement* targetElement) | 146 Vector<SVGElement*> findElementInstances(SVGElement* targetElement) |
147 { | 147 { |
148 ASSERT(targetElement); | 148 ASSERT(targetElement); |
149 Vector<SVGElement*> animatedElements; | 149 Vector<SVGElement*> animatedElements; |
150 | 150 |
151 animatedElements.append(targetElement); | 151 animatedElements.append(targetElement); |
152 | 152 |
153 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 153 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = ta
rgetElement->instancesForElement(); |
154 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 154 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
end = instances.end(); |
155 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 155 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
it = instances.begin(); it != end; ++it) { |
156 if (SVGElement* shadowTreeElement = *it) | 156 if (SVGElement* shadowTreeElement = *it) |
157 animatedElements.append(shadowTreeElement); | 157 animatedElements.append(shadowTreeElement); |
158 } | 158 } |
159 | 159 |
160 return animatedElements; | 160 return animatedElements; |
161 } | 161 } |
162 | 162 |
163 } | 163 } |
164 | 164 |
165 void SVGAnimateElement::resetAnimatedType() | 165 void SVGAnimateElement::resetAnimatedType() |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ASSERT(targetElement); | 230 ASSERT(targetElement); |
231 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 231 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
232 return; | 232 return; |
233 | 233 |
234 CSSPropertyID id = cssPropertyID(attributeName.localName()); | 234 CSSPropertyID id = cssPropertyID(attributeName.localName()); |
235 | 235 |
236 SVGElement::InstanceUpdateBlocker blocker(targetElement); | 236 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
237 applyCSSPropertyToTarget(targetElement, id, valueAsString); | 237 applyCSSPropertyToTarget(targetElement, id, valueAsString); |
238 | 238 |
239 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 239 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
240 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 240 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = ta
rgetElement->instancesForElement(); |
241 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 241 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
end = instances.end(); |
242 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 242 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
it = instances.begin(); it != end; ++it) { |
243 if (SVGElement* shadowTreeElement = *it) | 243 if (SVGElement* shadowTreeElement = *it) |
244 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); | 244 applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString); |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
248 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle
ment, const QualifiedName& attributeName) | 248 static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetEle
ment, const QualifiedName& attributeName) |
249 { | 249 { |
250 ASSERT(targetElement); | 250 ASSERT(targetElement); |
251 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 251 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
252 return; | 252 return; |
253 | 253 |
254 CSSPropertyID id = cssPropertyID(attributeName.localName()); | 254 CSSPropertyID id = cssPropertyID(attributeName.localName()); |
255 | 255 |
256 SVGElement::InstanceUpdateBlocker blocker(targetElement); | 256 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
257 removeCSSPropertyFromTarget(targetElement, id); | 257 removeCSSPropertyFromTarget(targetElement, id); |
258 | 258 |
259 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 259 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
260 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 260 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = ta
rgetElement->instancesForElement(); |
261 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 261 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
end = instances.end(); |
262 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 262 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
it = instances.begin(); it != end; ++it) { |
263 if (SVGElement* shadowTreeElement = *it) | 263 if (SVGElement* shadowTreeElement = *it) |
264 removeCSSPropertyFromTarget(shadowTreeElement, id); | 264 removeCSSPropertyFromTarget(shadowTreeElement, id); |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con
st QualifiedName& attributeName) | 268 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con
st QualifiedName& attributeName) |
269 { | 269 { |
270 #if !ENABLE(OILPAN) | 270 #if !ENABLE(OILPAN) |
271 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); | 271 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); |
272 #endif | 272 #endif |
273 targetElement->invalidateSVGAttributes(); | 273 targetElement->invalidateSVGAttributes(); |
274 targetElement->svgAttributeChanged(attributeName); | 274 targetElement->svgAttributeChanged(attributeName); |
275 } | 275 } |
276 | 276 |
277 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target
Element, const QualifiedName& attributeName) | 277 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target
Element, const QualifiedName& attributeName) |
278 { | 278 { |
279 ASSERT(targetElement); | 279 ASSERT(targetElement); |
280 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) | 280 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl
ement->parentNode()) |
281 return; | 281 return; |
282 | 282 |
283 SVGElement::InstanceUpdateBlocker blocker(targetElement); | 283 SVGElement::InstanceUpdateBlocker blocker(targetElement); |
284 notifyTargetAboutAnimValChange(targetElement, attributeName); | 284 notifyTargetAboutAnimValChange(targetElement, attributeName); |
285 | 285 |
286 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. | 286 // If the target element has instances, update them as well, w/o requiring t
he <use> tree to be rebuilt. |
287 const HashSet<SVGElement*>& instances = targetElement->instancesForElement()
; | 287 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& instances = ta
rgetElement->instancesForElement(); |
288 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 288 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
end = instances.end(); |
289 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end;
++it) { | 289 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator
it = instances.begin(); it != end; ++it) { |
290 if (SVGElement* shadowTreeElement = *it) | 290 if (SVGElement* shadowTreeElement = *it) |
291 notifyTargetAboutAnimValChange(shadowTreeElement, attributeName); | 291 notifyTargetAboutAnimValChange(shadowTreeElement, attributeName); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement) | 295 void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement) |
296 { | 296 { |
297 if (!m_animatedProperty) | 297 if (!m_animatedProperty) |
298 return; | 298 return; |
299 | 299 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() | 401 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() |
402 { | 402 { |
403 if (!m_animator) | 403 if (!m_animator) |
404 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi
s, targetElement()); | 404 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi
s, targetElement()); |
405 ASSERT(m_animatedPropertyType == m_animator->type()); | 405 ASSERT(m_animatedPropertyType == m_animator->type()); |
406 return m_animator.get(); | 406 return m_animator.get(); |
407 } | 407 } |
408 | 408 |
409 } | 409 } |
OLD | NEW |