| 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 12 matching lines...) Expand all Loading... |
| 23 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } | 23 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope
rty(property); } |
| 24 CSSValue* propertyValue(CSSPropertyID property) const | 24 CSSValue* propertyValue(CSSPropertyID property) const |
| 25 { | 25 { |
| 26 int index = m_propertySet->findPropertyIndex(property); | 26 int index = m_propertySet->findPropertyIndex(property); |
| 27 RELEASE_ASSERT(index >= 0); | 27 RELEASE_ASSERT(index >= 0); |
| 28 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); | 28 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); |
| 29 } | 29 } |
| 30 virtual PropertySet properties() const override; | 30 virtual PropertySet properties() const override; |
| 31 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const
{ return m_propertySet; } | 31 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const
{ return m_propertySet; } |
| 32 | 32 |
| 33 virtual void trace(Visitor*) override; | 33 DECLARE_VIRTUAL_TRACE(); |
| 34 | 34 |
| 35 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 35 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 36 public: | 36 public: |
| 37 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); | 37 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); |
| 38 | 38 |
| 39 CSSValue* value() const { return m_value.get(); } | 39 CSSValue* value() const { return m_value.get(); } |
| 40 void setEasing(PassRefPtrWillBeRawPtr<TimingFunction> easing) { m_easing
= easing; } | 40 void setEasing(PassRefPtrWillBeRawPtr<TimingFunction> easing) { m_easing
= easing; } |
| 41 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const override final { return m_animatableValueCache.get(); } | 41 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const override final { return m_animatableValueCache.get(); } |
| 42 void setAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue>); | 42 void setAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue>); |
| 43 | 43 |
| 44 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina
l; | 44 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina
l; |
| 45 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(C
SSPropertyID, blink::Keyframe::PropertySpecificKeyframe& end, Element*) const ov
erride final; | 45 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(C
SSPropertyID, blink::Keyframe::PropertySpecificKeyframe& end, Element*) const ov
erride final; |
| 46 | 46 |
| 47 virtual void trace(Visitor*) override; | 47 DECLARE_VIRTUAL_TRACE(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); | 50 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*); |
| 51 | 51 |
| 52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; | 52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; |
| 53 virtual bool isStringPropertySpecificKeyframe() const override { return
true; } | 53 virtual bool isStringPropertySpecificKeyframe() const override { return
true; } |
| 54 | 54 |
| 55 static bool createInterpolationsFromCSSValues(CSSPropertyID, CSSValue* f
romCSSValue, CSSValue* toCSSValue, Element*, OwnPtrWillBeRawPtr<WillBeHeapVector
<RefPtrWillBeMember<Interpolation>>>& interpolations); | 55 static bool createInterpolationsFromCSSValues(CSSPropertyID, CSSValue* f
romCSSValue, CSSValue* toCSSValue, Element*, OwnPtrWillBeRawPtr<WillBeHeapVector
<RefPtrWillBeMember<Interpolation>>>& interpolations); |
| 56 | 56 |
| 57 void ensureAnimatableValueCaches(CSSPropertyID, Keyframe::PropertySpecif
icKeyframe&, Element*, CSSValue& fromCSSValue, CSSValue& toCSSValue) const; | 57 void ensureAnimatableValueCaches(CSSPropertyID, Keyframe::PropertySpecif
icKeyframe&, Element*, CSSValue& fromCSSValue, CSSValue& toCSSValue) const; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe; | 78 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe; |
| 79 | 79 |
| 80 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); | 80 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); |
| 81 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); | 81 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); |
| 82 | 82 |
| 83 } | 83 } |
| 84 | 84 |
| 85 #endif | 85 #endif |
| OLD | NEW |