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/Keyframe.h" | 8 #include "core/animation/Keyframe.h" |
9 #include "core/css/StylePropertySet.h" | 9 #include "core/css/StylePropertySet.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class StyleSheetContents; | 13 class StyleSheetContents; |
14 | 14 |
15 class StringKeyframe : public Keyframe { | 15 class StringKeyframe : public Keyframe { |
| 16 friend class InspectorCSSAgent; |
| 17 |
16 public: | 18 public: |
17 static PassRefPtrWillBeRawPtr<StringKeyframe> create() | 19 static PassRefPtrWillBeRawPtr<StringKeyframe> create() |
18 { | 20 { |
19 return adoptRefWillBeNoop(new StringKeyframe); | 21 return adoptRefWillBeNoop(new StringKeyframe); |
20 } | 22 } |
21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); | 23 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); |
22 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } | 24 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } |
23 CSSValue* propertyValue(CSSPropertyID property) const | 25 CSSValue* propertyValue(CSSPropertyID property) const |
24 { | 26 { |
25 int index = m_propertySet->findPropertyIndex(property); | 27 int index = m_propertySet->findPropertyIndex(property); |
(...skipping 21 matching lines...) Expand all Loading... |
47 private: | 49 private: |
48 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); | 50 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); |
49 | 51 |
50 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; | 52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; |
51 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } | 53 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } |
52 | 54 |
53 RefPtrWillBeMember<CSSValue> m_value; | 55 RefPtrWillBeMember<CSSValue> m_value; |
54 mutable RefPtrWillBeMember<AnimatableValue> m_animatableValueCache; | 56 mutable RefPtrWillBeMember<AnimatableValue> m_animatableValueCache; |
55 }; | 57 }; |
56 | 58 |
| 59 protected: |
| 60 MutableStylePropertySet* propertySet () const { return m_propertySet.get();
} |
| 61 |
57 private: | 62 private: |
58 StringKeyframe() | 63 StringKeyframe() |
59 : m_propertySet(MutableStylePropertySet::create()) | 64 : m_propertySet(MutableStylePropertySet::create()) |
60 { } | 65 { } |
61 | 66 |
62 StringKeyframe(const StringKeyframe& copyFrom); | 67 StringKeyframe(const StringKeyframe& copyFrom); |
63 | 68 |
64 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; | 69 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; |
65 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; | 70 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; |
66 | 71 |
67 virtual bool isStringKeyframe() const OVERRIDE { return true; } | 72 virtual bool isStringKeyframe() const OVERRIDE { return true; } |
68 | 73 |
69 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; | 74 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; |
70 }; | 75 }; |
71 | 76 |
72 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; | 77 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; |
73 | 78 |
74 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); | 79 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); |
75 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); | 80 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); |
76 | 81 |
77 } | 82 } |
78 | 83 |
79 #endif | 84 #endif |
OLD | NEW |