| 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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); | 21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); |
| 22 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } | 22 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } |
| 23 CSSValue* propertyValue(CSSPropertyID property) const | 23 CSSValue* propertyValue(CSSPropertyID property) const |
| 24 { | 24 { |
| 25 int index = m_propertySet->findPropertyIndex(property); | 25 int index = m_propertySet->findPropertyIndex(property); |
| 26 RELEASE_ASSERT(index >= 0); | 26 RELEASE_ASSERT(index >= 0); |
| 27 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); | 27 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); |
| 28 } | 28 } |
| 29 virtual PropertySet properties() const override; | 29 virtual PropertySet properties() const override; |
| 30 | 30 |
| 31 virtual void trace(Visitor*) override; | |
| 32 | |
| 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 31 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 34 public: | 32 public: |
| 35 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); | 33 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); |
| 36 | 34 |
| 37 CSSValue* value() const { return m_value.get(); } | 35 CSSValue* value() const { return m_value.get(); } |
| 38 virtual const PassRefPtr<AnimatableValue> getAnimatableValue() const ove
rride final { | 36 virtual const PassRefPtr<AnimatableValue> getAnimatableValue() const ove
rride final { |
| 39 return m_animatableValueCache.get(); | 37 return m_animatableValueCache.get(); |
| 40 } | 38 } |
| 41 | 39 |
| 42 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(d
ouble offset, PassRefPtr<TimingFunction> easing) const override final; | 40 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(d
ouble offset, PassRefPtr<TimingFunction> easing) const override final; |
| 43 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, bli
nk::Keyframe::PropertySpecificKeyframe* end, Element*) const override final; | 41 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, bli
nk::Keyframe::PropertySpecificKeyframe* end, Element*) const override final; |
| 44 | 42 |
| 45 virtual void trace(Visitor*) override; | |
| 46 | |
| 47 private: | 43 private: |
| 48 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); | 44 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); |
| 49 | 45 |
| 50 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(d
ouble offset) const; | 46 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(d
ouble offset) const; |
| 51 virtual bool isStringPropertySpecificKeyframe() const override { return
true; } | 47 virtual bool isStringPropertySpecificKeyframe() const override { return
true; } |
| 52 | 48 |
| 53 RefPtr<CSSValue> m_value; | 49 RefPtr<CSSValue> m_value; |
| 54 mutable RefPtr<AnimatableValue> m_animatableValueCache; | 50 mutable RefPtr<AnimatableValue> m_animatableValueCache; |
| 55 }; | 51 }; |
| 56 | 52 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 70 }; | 66 }; |
| 71 | 67 |
| 72 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; | 68 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; |
| 73 | 69 |
| 74 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); | 70 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()); | 71 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); |
| 76 | 72 |
| 77 } | 73 } |
| 78 | 74 |
| 79 #endif | 75 #endif |
| OLD | NEW |