| 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 public: | 16 public: |
| 17 static PassRefPtrWillBeRawPtr<StringKeyframe> create() | 17 static PassRefPtrWillBeRawPtr<StringKeyframe> create() |
| 18 { | 18 { |
| 19 return adoptRefWillBeNoop(new StringKeyframe); | 19 return adoptRefWillBeNoop(new StringKeyframe); |
| 20 } | 20 } |
| 21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); | 21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents
*); |
| 22 void setPropertyValue(CSSPropertyID, PassRefPtr<CSSValue>); |
| 23 void setPropertyAnimatableValue(CSSPropertyID, PassRefPtr<AnimatableValue>); |
| 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); |
| 26 RELEASE_ASSERT(index >= 0); | 28 RELEASE_ASSERT(index >= 0); |
| 27 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); | 29 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); |
| 28 } | 30 } |
| 29 virtual PropertySet properties() const override; | 31 virtual PropertySet properties() const override; |
| 30 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const
{ return m_propertySet; } | 32 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const
{ return m_propertySet; } |
| 31 | 33 |
| 32 virtual void trace(Visitor*) override; | 34 virtual void trace(Visitor*) override; |
| 33 | 35 |
| 34 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 36 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 35 public: | 37 public: |
| 36 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation); | 38 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, CSSValue*, AnimationEffect::CompositeOperation, PassRefPtr<AnimatableValue> =
nullptr); |
| 37 | 39 |
| 38 CSSValue* value() const { return m_value.get(); } | 40 CSSValue* value() const { return m_value.get(); } |
| 39 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(); } |
| 40 | 42 |
| 41 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina
l; | 43 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina
l; |
| 42 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, blink::Keyframe::PropertySpecificKeyframe* end, Element*) const overrid
e final; | 44 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, blink::Keyframe::PropertySpecificKeyframe* end, Element*) const overrid
e final; |
| 43 | 45 |
| 44 virtual void trace(Visitor*) override; | 46 virtual void trace(Visitor*) override; |
| 45 | 47 |
| 46 private: | 48 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 59 { } | 61 { } |
| 60 | 62 |
| 61 StringKeyframe(const StringKeyframe& copyFrom); | 63 StringKeyframe(const StringKeyframe& copyFrom); |
| 62 | 64 |
| 63 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const override; | 65 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const override; |
| 64 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const override; | 66 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const override; |
| 65 | 67 |
| 66 virtual bool isStringKeyframe() const override { return true; } | 68 virtual bool isStringKeyframe() const override { return true; } |
| 67 | 69 |
| 68 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; | 70 RefPtrWillBeMember<MutableStylePropertySet> m_propertySet; |
| 71 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<AnimatableValue>> m_cach
edAnimatableValues; |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe; | 74 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe; |
| 72 | 75 |
| 73 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); | 76 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va
lue.isStringKeyframe()); |
| 74 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); | 77 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf
rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp
ecificKeyframe()); |
| 75 | 78 |
| 76 } | 79 } |
| 77 | 80 |
| 78 #endif | 81 #endif |
| OLD | NEW |