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 22 matching lines...) Expand all Loading... |
33 #include "core/page/UseCounter.h" | 33 #include "core/page/UseCounter.h" |
34 #include "core/svg/SVGAnimateElement.h" | 34 #include "core/svg/SVGAnimateElement.h" |
35 #include "core/svg/SVGElement.h" | 35 #include "core/svg/SVGElement.h" |
36 #include "core/svg/SVGParserUtilities.h" | 36 #include "core/svg/SVGParserUtilities.h" |
37 #include "platform/FloatConversion.h" | 37 #include "platform/FloatConversion.h" |
38 #include "wtf/MathExtras.h" | 38 #include "wtf/MathExtras.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 // Animated property definitions | 42 // Animated property definitions |
43 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequired
Attr, ExternalResourcesRequired, externalResourcesRequired) | |
44 | 43 |
45 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement) | 44 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement) |
46 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
47 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 45 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
48 END_REGISTER_ANIMATED_PROPERTIES | 46 END_REGISTER_ANIMATED_PROPERTIES |
49 | 47 |
50 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document&
document) | 48 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document&
document) |
51 : SVGSMILElement(tagName, document) | 49 : SVGSMILElement(tagName, document) |
52 , m_fromPropertyValueType(RegularPropertyValue) | 50 , m_fromPropertyValueType(RegularPropertyValue) |
53 , m_toPropertyValueType(RegularPropertyValue) | 51 , m_toPropertyValueType(RegularPropertyValue) |
54 , m_animationValid(false) | 52 , m_animationValid(false) |
55 , m_attributeType(AttributeTypeAuto) | 53 , m_attributeType(AttributeTypeAuto) |
56 , m_hasInvalidCSSAttributeType(false) | 54 , m_hasInvalidCSSAttributeType(false) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 parseKeySplinesInternal<LChar>(string, result); | 144 parseKeySplinesInternal<LChar>(string, result); |
147 else | 145 else |
148 parseKeySplinesInternal<UChar>(string, result); | 146 parseKeySplinesInternal<UChar>(string, result); |
149 } | 147 } |
150 | 148 |
151 bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName) | 149 bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName) |
152 { | 150 { |
153 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 151 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
154 if (supportedAttributes.isEmpty()) { | 152 if (supportedAttributes.isEmpty()) { |
155 SVGTests::addSupportedAttributes(supportedAttributes); | 153 SVGTests::addSupportedAttributes(supportedAttributes); |
156 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
157 supportedAttributes.add(SVGNames::valuesAttr); | 154 supportedAttributes.add(SVGNames::valuesAttr); |
158 supportedAttributes.add(SVGNames::keyTimesAttr); | 155 supportedAttributes.add(SVGNames::keyTimesAttr); |
159 supportedAttributes.add(SVGNames::keyPointsAttr); | 156 supportedAttributes.add(SVGNames::keyPointsAttr); |
160 supportedAttributes.add(SVGNames::keySplinesAttr); | 157 supportedAttributes.add(SVGNames::keySplinesAttr); |
161 supportedAttributes.add(SVGNames::attributeTypeAttr); | 158 supportedAttributes.add(SVGNames::attributeTypeAttr); |
162 supportedAttributes.add(SVGNames::calcModeAttr); | 159 supportedAttributes.add(SVGNames::calcModeAttr); |
163 supportedAttributes.add(SVGNames::fromAttr); | 160 supportedAttributes.add(SVGNames::fromAttr); |
164 supportedAttributes.add(SVGNames::toAttr); | 161 supportedAttributes.add(SVGNames::toAttr); |
165 supportedAttributes.add(SVGNames::byAttr); | 162 supportedAttributes.add(SVGNames::byAttr); |
166 } | 163 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 return; | 212 return; |
216 } | 213 } |
217 | 214 |
218 if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNam
es::byAttr) { | 215 if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNam
es::byAttr) { |
219 updateAnimationMode(); | 216 updateAnimationMode(); |
220 return; | 217 return; |
221 } | 218 } |
222 | 219 |
223 if (SVGTests::parseAttribute(name, value)) | 220 if (SVGTests::parseAttribute(name, value)) |
224 return; | 221 return; |
225 if (SVGExternalResourcesRequired::parseAttribute(name, value)) | |
226 return; | |
227 | 222 |
228 ASSERT_NOT_REACHED(); | 223 ASSERT_NOT_REACHED(); |
229 } | 224 } |
230 | 225 |
231 void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName) | 226 void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName) |
232 { | 227 { |
233 if (!isSupportedAttribute(attrName)) { | 228 if (!isSupportedAttribute(attrName)) { |
234 SVGSMILElement::svgAttributeChanged(attrName); | 229 SVGSMILElement::svgAttributeChanged(attrName); |
235 return; | 230 return; |
236 } | 231 } |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 SVGSMILElement::setAttributeName(attributeName); | 690 SVGSMILElement::setAttributeName(attributeName); |
696 checkInvalidCSSAttributeType(targetElement()); | 691 checkInvalidCSSAttributeType(targetElement()); |
697 } | 692 } |
698 | 693 |
699 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) | 694 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) |
700 { | 695 { |
701 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); | 696 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); |
702 } | 697 } |
703 | 698 |
704 } | 699 } |
OLD | NEW |