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, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 { | 361 { |
362 DEFINE_STATIC_LOCAL(const AtomicString, sum, ("sum", AtomicString::Construct
FromLiteral)); | 362 DEFINE_STATIC_LOCAL(const AtomicString, sum, ("sum", AtomicString::Construct
FromLiteral)); |
363 const AtomicString& value = fastGetAttribute(SVGNames::accumulateAttr); | 363 const AtomicString& value = fastGetAttribute(SVGNames::accumulateAttr); |
364 return value == sum && animationMode() != ToAnimation; | 364 return value == sum && animationMode() != ToAnimation; |
365 } | 365 } |
366 | 366 |
367 bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement
, const QualifiedName& attributeName) | 367 bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement
, const QualifiedName& attributeName) |
368 { | 368 { |
369 ASSERT(targetElement); | 369 ASSERT(targetElement); |
370 | 370 |
371 return SVGElement::isAnimatableCSSProperty(attributeName); | 371 return SVGElement::isAnimatableCSSProperty(attributeName) || targetElement->
isPresentationAttribute(attributeName); |
372 } | 372 } |
373 | 373 |
374 SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimat
ion(SVGElement* targetElement, const QualifiedName& attributeName) | 374 SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimat
ion(SVGElement* targetElement, const QualifiedName& attributeName) |
375 { | 375 { |
376 if (!hasValidAttributeType() || !targetElement || attributeName == anyQName(
)) | 376 if (!hasValidAttributeType() || !targetElement || attributeName == anyQName(
)) |
377 return DontApplyAnimation; | 377 return DontApplyAnimation; |
378 | 378 |
379 // Always animate CSS properties, using the ApplyCSSAnimation code path, reg
ardless of the attributeType value. | 379 // Always animate CSS properties, using the ApplyCSSAnimation code path, reg
ardless of the attributeType value. |
380 if (isTargetAttributeCSSProperty(targetElement, attributeName)) | 380 if (isTargetAttributeCSSProperty(targetElement, attributeName)) { |
| 381 if (targetElement->isPresentationAttributeWithSVGDOM(attributeName)) |
| 382 return ApplyXMLandCSSAnimation; |
| 383 |
381 return ApplyCSSAnimation; | 384 return ApplyCSSAnimation; |
382 | 385 } |
383 // If attributeType="CSS" and attributeName doesn't point to a CSS property,
ignore the animation. | 386 // If attributeType="CSS" and attributeName doesn't point to a CSS property,
ignore the animation. |
384 if (attributeType() == AttributeTypeCSS) | 387 if (attributeType() == AttributeTypeCSS) |
385 return DontApplyAnimation; | 388 return DontApplyAnimation; |
386 | 389 |
387 return ApplyXMLAnimation; | 390 return ApplyXMLAnimation; |
388 } | 391 } |
389 | 392 |
390 void SVGAnimationElement::calculateKeyTimesForCalcModePaced() | 393 void SVGAnimationElement::calculateKeyTimesForCalcModePaced() |
391 { | 394 { |
392 ASSERT(calcMode() == CalcModePaced); | 395 ASSERT(calcMode() == CalcModePaced); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 SVGSMILElement::setAttributeName(attributeName); | 711 SVGSMILElement::setAttributeName(attributeName); |
709 checkInvalidCSSAttributeType(targetElement()); | 712 checkInvalidCSSAttributeType(targetElement()); |
710 } | 713 } |
711 | 714 |
712 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) | 715 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) |
713 { | 716 { |
714 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); | 717 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); |
715 } | 718 } |
716 | 719 |
717 } | 720 } |
OLD | NEW |