Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateElement.h

Issue 2391993006: Move handling of 'attributeType' to SVGAnimateElement (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 bool calculateFromAndByValues(const String& fromString, 64 bool calculateFromAndByValues(const String& fromString,
65 const String& byString) final; 65 const String& byString) final;
66 void calculateAnimatedValue(float percentage, 66 void calculateAnimatedValue(float percentage,
67 unsigned repeatCount, 67 unsigned repeatCount,
68 SVGSMILElement* resultElement) final; 68 SVGSMILElement* resultElement) final;
69 void applyResultsToTarget() final; 69 void applyResultsToTarget() final;
70 float calculateDistance(const String& fromString, 70 float calculateDistance(const String& fromString,
71 const String& toString) final; 71 const String& toString) final;
72 bool isAdditive() final; 72 bool isAdditive() final;
73 73
74 void parseAttribute(const QualifiedName&,
75 const AtomicString&,
76 const AtomicString&) override;
77 void svgAttributeChanged(const QualifiedName&) override;
78
74 void setTargetElement(SVGElement*) final; 79 void setTargetElement(SVGElement*) final;
75 void setAttributeName(const QualifiedName&) final; 80 void setAttributeName(const QualifiedName&) final;
76 81
82 enum AttributeType { AttributeTypeCSS, AttributeTypeXML, AttributeTypeAuto };
83 AttributeType getAttributeType() const { return m_attributeType; }
84
77 FRIEND_TEST_ALL_PREFIXES(UnsafeSVGAttributeSanitizationTest, 85 FRIEND_TEST_ALL_PREFIXES(UnsafeSVGAttributeSanitizationTest,
78 stringsShouldNotSupportAddition); 86 stringsShouldNotSupportAddition);
79 87
80 private: 88 private:
81 void resetAnimatedPropertyType(); 89 void resetAnimatedPropertyType();
82 90
83 enum ShouldApplyAnimationType { 91 enum ShouldApplyAnimationType {
84 DontApplyAnimation, 92 DontApplyAnimation,
85 ApplyCSSAnimation, 93 ApplyCSSAnimation,
86 ApplyXMLAnimation, 94 ApplyXMLAnimation,
87 ApplyXMLandCSSAnimation 95 ApplyXMLandCSSAnimation
88 }; 96 };
89 97
90 ShouldApplyAnimationType shouldApplyAnimation( 98 ShouldApplyAnimationType shouldApplyAnimation(
91 SVGElement* targetElement, 99 SVGElement* targetElement,
92 const QualifiedName& attributeName); 100 const QualifiedName& attributeName);
93 101
102 void setAttributeType(const AtomicString&);
103
104 void checkInvalidCSSAttributeType();
105 bool hasInvalidCSSAttributeType() const {
106 return m_hasInvalidCSSAttributeType;
107 }
94 bool hasValidAttributeType() override; 108 bool hasValidAttributeType() override;
95 109
96 SVGPropertyBase* adjustForInheritance(SVGPropertyBase*, 110 SVGPropertyBase* adjustForInheritance(SVGPropertyBase*,
97 AnimatedPropertyValueType) const; 111 AnimatedPropertyValueType) const;
98 112
99 Member<SVGPropertyBase> m_fromProperty; 113 Member<SVGPropertyBase> m_fromProperty;
100 Member<SVGPropertyBase> m_toProperty; 114 Member<SVGPropertyBase> m_toProperty;
101 Member<SVGPropertyBase> m_toAtEndOfDurationProperty; 115 Member<SVGPropertyBase> m_toAtEndOfDurationProperty;
102 Member<SVGPropertyBase> m_animatedProperty; 116 Member<SVGPropertyBase> m_animatedProperty;
103 117
104 SVGAnimatedTypeAnimator m_animator; 118 SVGAnimatedTypeAnimator m_animator;
105 119
106 AnimatedPropertyValueType m_fromPropertyValueType; 120 AnimatedPropertyValueType m_fromPropertyValueType;
107 AnimatedPropertyValueType m_toPropertyValueType; 121 AnimatedPropertyValueType m_toPropertyValueType;
122 AttributeType m_attributeType;
123 bool m_hasInvalidCSSAttributeType;
108 }; 124 };
109 125
110 inline bool isSVGAnimateElement(const SVGElement& element) { 126 inline bool isSVGAnimateElement(const SVGElement& element) {
111 return element.hasTagName(SVGNames::animateTag) || 127 return element.hasTagName(SVGNames::animateTag) ||
112 element.hasTagName(SVGNames::animateTransformTag) || 128 element.hasTagName(SVGNames::animateTransformTag) ||
113 element.hasTagName(SVGNames::setTag); 129 element.hasTagName(SVGNames::setTag);
114 } 130 }
115 131
116 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement); 132 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement);
117 133
118 } // namespace blink 134 } // namespace blink
119 135
120 #endif // SVGAnimateElement_h 136 #endif // SVGAnimateElement_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698