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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
43 } | 43 } |
44 | 44 |
45 PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(Document& document) | 45 PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(Document& document) |
46 { | 46 { |
47 return adoptRef(new SVGAnimateElement(SVGNames::animateTag, document)); | 47 return adoptRef(new SVGAnimateElement(SVGNames::animateTag, document)); |
48 } | 48 } |
49 | 49 |
50 SVGAnimateElement::~SVGAnimateElement() | 50 SVGAnimateElement::~SVGAnimateElement() |
51 { | 51 { |
52 #if !ENABLE(OILPAN) | |
52 if (targetElement()) | 53 if (targetElement()) |
53 clearAnimatedType(targetElement()); | 54 clearAnimatedType(targetElement()); |
haraken
2014/05/06 15:59:42
clearAnimatedType is doing a bunch of non-trivial
kouhei (in TOK)
2014/05/07 01:43:13
Removing <animate> tag means it should stop the SM
Mads Ager (chromium)
2014/05/07 12:13:16
Kouhei, would it be possible to write a test case
| |
55 #endif | |
54 } | 56 } |
55 | 57 |
56 bool SVGAnimateElement::hasValidAttributeType() | 58 bool SVGAnimateElement::hasValidAttributeType() |
57 { | 59 { |
58 SVGElement* targetElement = this->targetElement(); | 60 SVGElement* targetElement = this->targetElement(); |
59 if (!targetElement) | 61 if (!targetElement) |
60 return false; | 62 return false; |
61 | 63 |
62 return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeT ype(); | 64 return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeT ype(); |
63 } | 65 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 if (shouldApply == ApplyCSSAnimation) { | 198 if (shouldApply == ApplyCSSAnimation) { |
197 ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement, attributeName)); | 199 ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement, attributeName)); |
198 computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.local Name()), baseValue); | 200 computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.local Name()), baseValue); |
199 } | 201 } |
200 | 202 |
201 m_animatedProperty = animator->constructFromString(baseValue); | 203 m_animatedProperty = animator->constructFromString(baseValue); |
202 } | 204 } |
203 | 205 |
204 static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSProper tyID id, const String& value) | 206 static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSProper tyID id, const String& value) |
205 { | 207 { |
208 #if !ENABLE(OILPAN) | |
206 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); | 209 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); |
210 #endif | |
207 | 211 |
208 MutableStylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyl eProperties(); | 212 MutableStylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyl eProperties(); |
209 if (!propertySet->setProperty(id, value, false, 0)) | 213 if (!propertySet->setProperty(id, value, false, 0)) |
210 return; | 214 return; |
211 | 215 |
212 targetElement->setNeedsStyleRecalc(LocalStyleChange); | 216 targetElement->setNeedsStyleRecalc(LocalStyleChange); |
213 } | 217 } |
214 | 218 |
215 static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPro pertyID id) | 219 static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPro pertyID id) |
216 { | 220 { |
221 #if !ENABLE(OILPAN) | |
217 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); | 222 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); |
223 #endif | |
218 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id); | 224 targetElement->ensureAnimatedSMILStyleProperties()->removeProperty(id); |
219 targetElement->setNeedsStyleRecalc(LocalStyleChange); | 225 targetElement->setNeedsStyleRecalc(LocalStyleChange); |
220 } | 226 } |
221 | 227 |
222 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString) | 228 static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElemen t, const QualifiedName& attributeName, const String& valueAsString) |
223 { | 229 { |
224 ASSERT(targetElement); | 230 ASSERT(targetElement); |
225 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) | 231 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) |
226 return; | 232 return; |
227 | 233 |
(...skipping 26 matching lines...) Expand all Loading... | |
254 const HashSet<SVGElement*>& instances = targetElement->instancesForElement() ; | 260 const HashSet<SVGElement*>& instances = targetElement->instancesForElement() ; |
255 const HashSet<SVGElement*>::const_iterator end = instances.end(); | 261 const HashSet<SVGElement*>::const_iterator end = instances.end(); |
256 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end; ++it) { | 262 for (HashSet<SVGElement*>::const_iterator it = instances.begin(); it != end; ++it) { |
257 if (SVGElement* shadowTreeElement = *it) | 263 if (SVGElement* shadowTreeElement = *it) |
258 removeCSSPropertyFromTarget(shadowTreeElement, id); | 264 removeCSSPropertyFromTarget(shadowTreeElement, id); |
259 } | 265 } |
260 } | 266 } |
261 | 267 |
262 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName) | 268 static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, con st QualifiedName& attributeName) |
263 { | 269 { |
270 #if !ENABLE(OILPAN) | |
264 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); | 271 ASSERT_WITH_SECURITY_IMPLICATION(!targetElement->m_deletionHasBegun); |
272 #endif | |
265 targetElement->invalidateSVGAttributes(); | 273 targetElement->invalidateSVGAttributes(); |
266 targetElement->svgAttributeChanged(attributeName); | 274 targetElement->svgAttributeChanged(attributeName); |
267 } | 275 } |
268 | 276 |
269 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName) | 277 static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* target Element, const QualifiedName& attributeName) |
270 { | 278 { |
271 ASSERT(targetElement); | 279 ASSERT(targetElement); |
272 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) | 280 if (attributeName == anyQName() || !targetElement->inDocument() || !targetEl ement->parentNode()) |
273 return; | 281 return; |
274 | 282 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 | 400 |
393 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() | 401 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() |
394 { | 402 { |
395 if (!m_animator) | 403 if (!m_animator) |
396 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi s, targetElement()); | 404 m_animator = SVGAnimatedTypeAnimator::create(m_animatedPropertyType, thi s, targetElement()); |
397 ASSERT(m_animatedPropertyType == m_animator->type()); | 405 ASSERT(m_animatedPropertyType == m_animator->type()); |
398 return m_animator.get(); | 406 return m_animator.get(); |
399 } | 407 } |
400 | 408 |
401 } | 409 } |
OLD | NEW |