OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef NewSVGProperty_h | 31 #ifndef SVGProperty_h |
32 #define NewSVGProperty_h | 32 #define SVGProperty_h |
33 | 33 |
34 #include "core/svg/properties/SVGPropertyInfo.h" | 34 #include "core/svg/properties/SVGPropertyInfo.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
37 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class ExceptionState; | 42 class ExceptionState; |
43 class QualifiedName; | 43 class QualifiedName; |
44 class SVGElement; | 44 class SVGElement; |
45 class SVGAnimationElement; | 45 class SVGAnimationElement; |
46 | 46 |
47 class NewSVGPropertyBase : public RefCounted<NewSVGPropertyBase> { | 47 class SVGPropertyBase : public RefCounted<SVGPropertyBase> { |
48 WTF_MAKE_NONCOPYABLE(NewSVGPropertyBase); | 48 WTF_MAKE_NONCOPYABLE(SVGPropertyBase); |
49 | 49 |
50 public: | 50 public: |
51 // Properties do not have a primitive type by default | 51 // Properties do not have a primitive type by default |
52 typedef void PrimitiveType; | 52 typedef void PrimitiveType; |
53 | 53 |
54 virtual ~NewSVGPropertyBase() | 54 virtual ~SVGPropertyBase() |
55 { | 55 { |
56 ASSERT(!m_ownerList); | 56 ASSERT(!m_ownerList); |
57 } | 57 } |
58 | 58 |
59 // FIXME: remove this in WebAnimations transition. | 59 // FIXME: remove this in WebAnimations transition. |
60 // This is used from SVGAnimatedNewPropertyAnimator for its animate-by-strin
g implementation. | 60 // This is used from SVGAnimatedNewPropertyAnimator for its animate-by-strin
g implementation. |
61 virtual PassRefPtr<NewSVGPropertyBase> cloneForAnimation(const String&) cons
t = 0; | 61 virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String&) const =
0; |
62 | 62 |
63 virtual String valueAsString() const = 0; | 63 virtual String valueAsString() const = 0; |
64 | 64 |
65 // FIXME: remove below and just have this inherit AnimatableValue in WebAnim
ations transition. | 65 // FIXME: remove below and just have this inherit AnimatableValue in WebAnim
ations transition. |
66 virtual void add(PassRefPtr<NewSVGPropertyBase>, SVGElement*) = 0; | 66 virtual void add(PassRefPtr<SVGPropertyBase>, SVGElement*) = 0; |
67 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<NewSVGPropertyBase> from, PassRefPtr<NewSVGProp
ertyBase> to, PassRefPtr<NewSVGPropertyBase> toAtEndOfDurationValue, SVGElement*
) = 0; | 67 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBa
se> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement*) = 0; |
68 virtual float calculateDistance(PassRefPtr<NewSVGPropertyBase> to, SVGElemen
t*) = 0; | 68 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*)
= 0; |
69 | 69 |
70 AnimatedPropertyType type() | 70 AnimatedPropertyType type() |
71 { | 71 { |
72 return m_type; | 72 return m_type; |
73 } | 73 } |
74 | 74 |
75 NewSVGPropertyBase* ownerList() const | 75 SVGPropertyBase* ownerList() const |
76 { | 76 { |
77 return m_ownerList; | 77 return m_ownerList; |
78 } | 78 } |
79 | 79 |
80 void setOwnerList(NewSVGPropertyBase* ownerList) | 80 void setOwnerList(SVGPropertyBase* ownerList) |
81 { | 81 { |
82 // Previous owner list must be cleared before setting new owner list. | 82 // Previous owner list must be cleared before setting new owner list. |
83 ASSERT((!ownerList && m_ownerList) || (ownerList && !m_ownerList)); | 83 ASSERT((!ownerList && m_ownerList) || (ownerList && !m_ownerList)); |
84 | 84 |
85 m_ownerList = ownerList; | 85 m_ownerList = ownerList; |
86 } | 86 } |
87 | 87 |
88 protected: | 88 protected: |
89 explicit NewSVGPropertyBase(AnimatedPropertyType type) | 89 explicit SVGPropertyBase(AnimatedPropertyType type) |
90 : m_type(type) | 90 : m_type(type) |
91 , m_ownerList(0) | 91 , m_ownerList(0) |
92 { | 92 { |
93 } | 93 } |
94 | 94 |
95 private: | 95 private: |
96 const AnimatedPropertyType m_type; | 96 const AnimatedPropertyType m_type; |
97 | 97 |
98 // FIXME: oilpan: This is kept as a raw ptr to break reference cycle. Should
be Member in oilpan. | 98 // FIXME: oilpan: This is kept as a raw ptr to break reference cycle. Should
be Member in oilpan. |
99 NewSVGPropertyBase* m_ownerList; | 99 SVGPropertyBase* m_ownerList; |
100 }; | 100 }; |
101 | 101 |
102 } | 102 } |
103 | 103 |
104 #endif // NewSVGProperty_h | 104 #endif // SVGProperty_h |
OLD | NEW |