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 12 matching lines...) Expand all Loading... |
23 */ | 23 */ |
24 | 24 |
25 #include "config.h" | 25 #include "config.h" |
26 | 26 |
27 #include "core/svg/SVGAnimationElement.h" | 27 #include "core/svg/SVGAnimationElement.h" |
28 | 28 |
29 #include "CSSPropertyNames.h" | 29 #include "CSSPropertyNames.h" |
30 #include "SVGNames.h" | 30 #include "SVGNames.h" |
31 #include "core/css/CSSComputedStyleDeclaration.h" | 31 #include "core/css/CSSComputedStyleDeclaration.h" |
32 #include "core/css/CSSParser.h" | 32 #include "core/css/CSSParser.h" |
| 33 #include "core/page/UseCounter.h" |
33 #include "core/platform/FloatConversion.h" | 34 #include "core/platform/FloatConversion.h" |
34 #include "core/svg/SVGAnimateElement.h" | 35 #include "core/svg/SVGAnimateElement.h" |
35 #include "core/svg/SVGParserUtilities.h" | 36 #include "core/svg/SVGParserUtilities.h" |
36 #include "core/svg/SVGStyledElement.h" | 37 #include "core/svg/SVGStyledElement.h" |
37 #include <wtf/MathExtras.h> | 38 #include <wtf/MathExtras.h> |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 // Animated property definitions | 42 // Animated property definitions |
42 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequired
Attr, ExternalResourcesRequired, externalResourcesRequired) | 43 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequired
Attr, ExternalResourcesRequired, externalResourcesRequired) |
43 | 44 |
44 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement) | 45 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement) |
45 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 46 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
46 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 47 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
47 END_REGISTER_ANIMATED_PROPERTIES | 48 END_REGISTER_ANIMATED_PROPERTIES |
48 | 49 |
49 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document*
document) | 50 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document*
document) |
50 : SVGSMILElement(tagName, document) | 51 : SVGSMILElement(tagName, document) |
51 , m_fromPropertyValueType(RegularPropertyValue) | 52 , m_fromPropertyValueType(RegularPropertyValue) |
52 , m_toPropertyValueType(RegularPropertyValue) | 53 , m_toPropertyValueType(RegularPropertyValue) |
53 , m_animationValid(false) | 54 , m_animationValid(false) |
54 , m_attributeType(AttributeTypeAuto) | 55 , m_attributeType(AttributeTypeAuto) |
55 , m_hasInvalidCSSAttributeType(false) | 56 , m_hasInvalidCSSAttributeType(false) |
56 , m_calcMode(CalcModeLinear) | 57 , m_calcMode(CalcModeLinear) |
57 , m_animationMode(NoAnimation) | 58 , m_animationMode(NoAnimation) |
58 { | 59 { |
59 ScriptWrappable::init(this); | 60 ScriptWrappable::init(this); |
60 registerAnimatedPropertiesForSVGAnimationElement(); | 61 registerAnimatedPropertiesForSVGAnimationElement(); |
| 62 |
| 63 UseCounter::count(document, UseCounter::SVGAnimationElement); |
61 } | 64 } |
62 | 65 |
63 static void parseKeyTimes(const String& string, Vector<float>& result, bool veri
fyOrder) | 66 static void parseKeyTimes(const String& string, Vector<float>& result, bool veri
fyOrder) |
64 { | 67 { |
65 result.clear(); | 68 result.clear(); |
66 Vector<String> parseList; | 69 Vector<String> parseList; |
67 string.split(';', parseList); | 70 string.split(';', parseList); |
68 for (unsigned n = 0; n < parseList.size(); ++n) { | 71 for (unsigned n = 0; n < parseList.size(); ++n) { |
69 String timeString = parseList[n]; | 72 String timeString = parseList[n]; |
70 bool ok; | 73 bool ok; |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 SVGSMILElement::setAttributeName(attributeName); | 700 SVGSMILElement::setAttributeName(attributeName); |
698 checkInvalidCSSAttributeType(targetElement()); | 701 checkInvalidCSSAttributeType(targetElement()); |
699 } | 702 } |
700 | 703 |
701 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) | 704 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) |
702 { | 705 { |
703 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); | 706 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); |
704 } | 707 } |
705 | 708 |
706 } | 709 } |
OLD | NEW |