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

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

Issue 1991513003: Lock animated property type of result animation during processing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lock-animated-property-in
Patch Set: Created 4 years, 7 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 bool isSVGAnimationAttributeSettingJavaScriptURL(const Attribute&) const ove rride; 46 bool isSVGAnimationAttributeSettingJavaScriptURL(const Attribute&) const ove rride;
47 47
48 AnimatedPropertyType animatedPropertyType(); 48 AnimatedPropertyType animatedPropertyType();
49 bool animatedPropertyTypeSupportsAddition(); 49 bool animatedPropertyTypeSupportsAddition();
50 50
51 static SVGElementInstances findElementInstances(SVGElement* targetElement); 51 static SVGElementInstances findElementInstances(SVGElement* targetElement);
52 52
53 protected: 53 protected:
54 SVGAnimateElement(const QualifiedName&, Document&); 54 SVGAnimateElement(const QualifiedName&, Document&);
55 55
56 void lockAnimatedType() final { DCHECK(!m_animatedPropertyLocked); m_animate dPropertyLocked = true; }
57 void unlockAnimatedType() final { DCHECK(m_animatedPropertyLocked); m_animat edPropertyLocked = false; }
58
56 void resetAnimatedType() final; 59 void resetAnimatedType() final;
57 void clearAnimatedType() final; 60 void clearAnimatedType() final;
58 61
59 bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) final; 62 bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) final;
60 bool calculateFromAndToValues(const String& fromString, const String& toStri ng) final; 63 bool calculateFromAndToValues(const String& fromString, const String& toStri ng) final;
61 bool calculateFromAndByValues(const String& fromString, const String& byStri ng) final; 64 bool calculateFromAndByValues(const String& fromString, const String& byStri ng) final;
62 void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILE lement* resultElement) final; 65 void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILE lement* resultElement) final;
63 void applyResultsToTarget() final; 66 void applyResultsToTarget() final;
64 float calculateDistance(const String& fromString, const String& toString) fi nal; 67 float calculateDistance(const String& fromString, const String& toString) fi nal;
65 bool isAdditive() final; 68 bool isAdditive() final;
66 69
67 void setTargetElement(SVGElement*) final; 70 void setTargetElement(SVGElement*) final;
68 void setAttributeName(const QualifiedName&) final; 71 void setAttributeName(const QualifiedName&) final;
69 72
70 FRIEND_TEST_ALL_PREFIXES(UnsafeSVGAttributeSanitizationTest, stringsShouldNo tSupportAddition); 73 FRIEND_TEST_ALL_PREFIXES(UnsafeSVGAttributeSanitizationTest, stringsShouldNo tSupportAddition);
71 74
72 private: 75 private:
73 void resetAnimatedPropertyType(); 76 void resetAnimatedPropertyType();
74 77
75 bool hasValidAttributeType() override; 78 bool hasValidAttributeType() override;
76 79
77 Member<SVGPropertyBase> m_fromProperty; 80 Member<SVGPropertyBase> m_fromProperty;
78 Member<SVGPropertyBase> m_toProperty; 81 Member<SVGPropertyBase> m_toProperty;
79 Member<SVGPropertyBase> m_toAtEndOfDurationProperty; 82 Member<SVGPropertyBase> m_toAtEndOfDurationProperty;
80 Member<SVGPropertyBase> m_animatedProperty; 83 Member<SVGPropertyBase> m_animatedProperty;
81 84
82 SVGAnimatedTypeAnimator m_animator; 85 SVGAnimatedTypeAnimator m_animator;
86
87 bool m_animatedPropertyLocked;
83 }; 88 };
84 89
85 inline bool isSVGAnimateElement(const SVGElement& element) 90 inline bool isSVGAnimateElement(const SVGElement& element)
86 { 91 {
87 return element.hasTagName(SVGNames::animateTag) 92 return element.hasTagName(SVGNames::animateTag)
88 || element.hasTagName(SVGNames::animateTransformTag) 93 || element.hasTagName(SVGNames::animateTransformTag)
89 || element.hasTagName(SVGNames::setTag); 94 || element.hasTagName(SVGNames::setTag);
90 } 95 }
91 96
92 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement); 97 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement);
93 98
94 } // namespace blink 99 } // namespace blink
95 100
96 #endif // SVGAnimateElement_h 101 #endif // SVGAnimateElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698