OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef StringKeyframe_h | 5 #ifndef StringKeyframe_h |
6 #define StringKeyframe_h | 6 #define StringKeyframe_h |
7 | 7 |
| 8 #include "core/animation/InterpolableValuePromise.h" |
8 #include "core/animation/Keyframe.h" | 9 #include "core/animation/Keyframe.h" |
9 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
10 | 11 |
11 namespace WebCore { | 12 namespace WebCore { |
12 | 13 |
13 class StyleSheetContents; | 14 class StyleSheetContents; |
14 | 15 |
15 class StringKeyframe : public Keyframe { | 16 class StringKeyframe : public Keyframe { |
16 public: | 17 public: |
17 static PassRefPtrWillBeRawPtr<StringKeyframe> create() | 18 static PassRefPtrWillBeRawPtr<StringKeyframe> create() |
(...skipping 10 matching lines...) Expand all Loading... |
28 } | 29 } |
29 virtual PropertySet properties() const OVERRIDE; | 30 virtual PropertySet properties() const OVERRIDE; |
30 | 31 |
31 virtual void trace(Visitor*) OVERRIDE; | 32 virtual void trace(Visitor*) OVERRIDE; |
32 | 33 |
33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 34 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
34 public: | 35 public: |
35 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); | 36 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); |
36 | 37 |
37 CSSValue* value() const { return m_value.get(); } | 38 CSSValue* value() const { return m_value.get(); } |
38 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const OVERRIDE FINAL { | 39 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const OVERRIDE FINAL; |
39 ASSERT(m_animatableValueCache); | |
40 return m_animatableValueCache.get(); | |
41 } | |
42 | 40 |
43 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINA
L; | 41 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINA
L; |
44 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, WebCore::Keyframe::PropertySpecificKeyframe* end, Element*) const OVERR
IDE FINAL; | 42 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, WebCore::Keyframe::PropertySpecificKeyframe* end, Element*) const OVERR
IDE FINAL; |
45 | 43 |
46 virtual void trace(Visitor*) OVERRIDE; | 44 virtual void trace(Visitor*) OVERRIDE; |
47 | 45 |
48 private: | 46 private: |
49 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); | 47 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); |
50 | 48 |
51 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; | 49 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; |
52 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } | 50 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } |
53 | 51 |
54 RefPtrWillBeMember<CSSValue> m_value; | 52 RefPtrWillBeMember<CSSValue> m_value; |
55 mutable RefPtrWillBeMember<AnimatableValue> m_animatableValueCache; | 53 mutable RefPtrWillBeMember<InterpolableValuePromise> m_interpolableValue
PromiseCache; |
56 }; | 54 }; |
57 | 55 |
58 private: | 56 private: |
59 StringKeyframe() | 57 StringKeyframe() |
60 : m_propertySet(MutableStylePropertySet::create()) | 58 : m_propertySet(MutableStylePropertySet::create()) |
61 { } | 59 { } |
62 | 60 |
63 StringKeyframe(const StringKeyframe& copyFrom); | 61 StringKeyframe(const StringKeyframe& copyFrom); |
64 | 62 |
65 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; | 63 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; |
66 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; | 64 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; |
67 | 65 |
68 virtual bool isStringKeyframe() const OVERRIDE { return true; } | 66 virtual bool isStringKeyframe() const OVERRIDE { return true; } |
69 | 67 |
70 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; | 68 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; |
71 }; | 69 }; |
72 | 70 |
73 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; | 71 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; |
74 | 72 |
75 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); | 73 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); |
76 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); | 74 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); |
77 | 75 |
78 } | 76 } |
79 | 77 |
80 #endif | 78 #endif |
OLD | NEW |