| 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 23 matching lines...) Expand all Loading... |
| 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 blink { | 40 namespace blink { |
| 41 | 41 |
| 42 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document&
document) | 42 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document&
document) |
| 43 : SVGSMILElement(tagName, document) | 43 : SVGSMILElement(tagName, document) |
| 44 , SVGTests(this) | |
| 45 , m_fromPropertyValueType(RegularPropertyValue) | 44 , m_fromPropertyValueType(RegularPropertyValue) |
| 46 , m_toPropertyValueType(RegularPropertyValue) | 45 , m_toPropertyValueType(RegularPropertyValue) |
| 47 , m_animationValid(false) | 46 , m_animationValid(false) |
| 48 , m_attributeType(AttributeTypeAuto) | 47 , m_attributeType(AttributeTypeAuto) |
| 49 , m_hasInvalidCSSAttributeType(false) | 48 , m_hasInvalidCSSAttributeType(false) |
| 50 , m_calcMode(CalcModeLinear) | 49 , m_calcMode(CalcModeLinear) |
| 51 , m_animationMode(NoAnimation) | 50 , m_animationMode(NoAnimation) |
| 52 { | 51 { |
| 53 UseCounter::count(document, UseCounter::SVGAnimationElement); | 52 UseCounter::count(document, UseCounter::SVGAnimationElement); |
| 54 } | 53 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (string.is8Bit()) | 134 if (string.is8Bit()) |
| 136 parseKeySplinesInternal<LChar>(string, result); | 135 parseKeySplinesInternal<LChar>(string, result); |
| 137 else | 136 else |
| 138 parseKeySplinesInternal<UChar>(string, result); | 137 parseKeySplinesInternal<UChar>(string, result); |
| 139 } | 138 } |
| 140 | 139 |
| 141 bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName) | 140 bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName) |
| 142 { | 141 { |
| 143 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 142 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 144 if (supportedAttributes.isEmpty()) { | 143 if (supportedAttributes.isEmpty()) { |
| 145 SVGTests::addSupportedAttributes(supportedAttributes); | |
| 146 supportedAttributes.add(SVGNames::valuesAttr); | 144 supportedAttributes.add(SVGNames::valuesAttr); |
| 147 supportedAttributes.add(SVGNames::keyTimesAttr); | 145 supportedAttributes.add(SVGNames::keyTimesAttr); |
| 148 supportedAttributes.add(SVGNames::keyPointsAttr); | 146 supportedAttributes.add(SVGNames::keyPointsAttr); |
| 149 supportedAttributes.add(SVGNames::keySplinesAttr); | 147 supportedAttributes.add(SVGNames::keySplinesAttr); |
| 150 supportedAttributes.add(SVGNames::attributeTypeAttr); | 148 supportedAttributes.add(SVGNames::attributeTypeAttr); |
| 151 supportedAttributes.add(SVGNames::calcModeAttr); | 149 supportedAttributes.add(SVGNames::calcModeAttr); |
| 152 supportedAttributes.add(SVGNames::fromAttr); | 150 supportedAttributes.add(SVGNames::fromAttr); |
| 153 supportedAttributes.add(SVGNames::toAttr); | 151 supportedAttributes.add(SVGNames::toAttr); |
| 154 supportedAttributes.add(SVGNames::byAttr); | 152 supportedAttributes.add(SVGNames::byAttr); |
| 155 } | 153 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (name == SVGNames::calcModeAttr) { | 200 if (name == SVGNames::calcModeAttr) { |
| 203 setCalcMode(value); | 201 setCalcMode(value); |
| 204 return; | 202 return; |
| 205 } | 203 } |
| 206 | 204 |
| 207 if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNam
es::byAttr) { | 205 if (name == SVGNames::fromAttr || name == SVGNames::toAttr || name == SVGNam
es::byAttr) { |
| 208 updateAnimationMode(); | 206 updateAnimationMode(); |
| 209 return; | 207 return; |
| 210 } | 208 } |
| 211 | 209 |
| 212 if (SVGTests::parseAttribute(name, value)) | |
| 213 return; | |
| 214 | |
| 215 ASSERT_NOT_REACHED(); | 210 ASSERT_NOT_REACHED(); |
| 216 } | 211 } |
| 217 | 212 |
| 218 void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName) | 213 void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName) |
| 219 { | 214 { |
| 220 if (!isSupportedAttribute(attrName)) { | 215 if (!isSupportedAttribute(attrName)) { |
| 221 SVGSMILElement::svgAttributeChanged(attrName); | 216 SVGSMILElement::svgAttributeChanged(attrName); |
| 222 return; | 217 return; |
| 223 } | 218 } |
| 224 | 219 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 SVGSMILElement::setAttributeName(attributeName); | 681 SVGSMILElement::setAttributeName(attributeName); |
| 687 checkInvalidCSSAttributeType(targetElement()); | 682 checkInvalidCSSAttributeType(targetElement()); |
| 688 } | 683 } |
| 689 | 684 |
| 690 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) | 685 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) |
| 691 { | 686 { |
| 692 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); | 687 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); |
| 693 } | 688 } |
| 694 | 689 |
| 695 } | 690 } |
| OLD | NEW |