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 21 matching lines...) Expand all Loading... |
32 #include "core/svg/SVGAnimatedTypeAnimator.h" | 32 #include "core/svg/SVGAnimatedTypeAnimator.h" |
33 #include "core/svg/SVGAnimatorFactory.h" | 33 #include "core/svg/SVGAnimatorFactory.h" |
34 #include "core/svg/SVGDocumentExtensions.h" | 34 #include "core/svg/SVGDocumentExtensions.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document& doc
ument) | 38 SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document& doc
ument) |
39 : SVGAnimationElement(tagName, document) | 39 : SVGAnimationElement(tagName, document) |
40 , m_animatedPropertyType(AnimatedString) | 40 , m_animatedPropertyType(AnimatedString) |
41 { | 41 { |
42 ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || h
asTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag
)); | 42 ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || h
asTagName(SVGNames::animateTransformTag)); |
43 ScriptWrappable::init(this); | 43 ScriptWrappable::init(this); |
44 } | 44 } |
45 | 45 |
46 PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(Document& document) | 46 PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(Document& document) |
47 { | 47 { |
48 return adoptRef(new SVGAnimateElement(SVGNames::animateTag, document)); | 48 return adoptRef(new SVGAnimateElement(SVGNames::animateTag, document)); |
49 } | 49 } |
50 | 50 |
51 SVGAnimateElement::~SVGAnimateElement() | 51 SVGAnimateElement::~SVGAnimateElement() |
52 { | 52 { |
(...skipping 14 matching lines...) Expand all Loading... |
67 { | 67 { |
68 ASSERT(targetElement); | 68 ASSERT(targetElement); |
69 | 69 |
70 Vector<AnimatedPropertyType> propertyTypes; | 70 Vector<AnimatedPropertyType> propertyTypes; |
71 targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTyp
es); | 71 targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTyp
es); |
72 if (propertyTypes.isEmpty()) | 72 if (propertyTypes.isEmpty()) |
73 return AnimatedUnknown; | 73 return AnimatedUnknown; |
74 | 74 |
75 ASSERT(propertyTypes.size() <= 2); | 75 ASSERT(propertyTypes.size() <= 2); |
76 AnimatedPropertyType type = propertyTypes[0]; | 76 AnimatedPropertyType type = propertyTypes[0]; |
77 if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor) | |
78 return AnimatedUnknown; | |
79 | 77 |
80 // Animations of transform lists are not allowed for <animate> or <set> | 78 // Animations of transform lists are not allowed for <animate> or <set> |
81 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties | 79 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties |
82 if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformT
ag)) | 80 if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformT
ag)) |
83 return AnimatedUnknown; | 81 return AnimatedUnknown; |
84 | 82 |
85 // Fortunately there's just one special case needed here: SVGMarkerElements
orientAttr, which | 83 // Fortunately there's just one special case needed here: SVGMarkerElements
orientAttr, which |
86 // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration or
ientType. We have to | 84 // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration or
ientType. We have to |
87 // figure out whose value to change here. | 85 // figure out whose value to change here. |
88 if (targetElement->hasTagName(SVGNames::markerTag) && type == AnimatedAngle)
{ | 86 if (targetElement->hasTagName(SVGNames::markerTag) && type == AnimatedAngle)
{ |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 431 |
434 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() | 432 SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator() |
435 { | 433 { |
436 if (!m_animator) | 434 if (!m_animator) |
437 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animate
dPropertyType); | 435 m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animate
dPropertyType); |
438 ASSERT(m_animatedPropertyType == m_animator->type()); | 436 ASSERT(m_animatedPropertyType == m_animator->type()); |
439 return m_animator.get(); | 437 return m_animator.get(); |
440 } | 438 } |
441 | 439 |
442 } | 440 } |
OLD | NEW |