| 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/AnimatableValue.h" | 8 #include "core/animation/AnimatableValue.h" |
| 9 #include "core/animation/Keyframe.h" | 9 #include "core/animation/Keyframe.h" |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 class StringKeyframe : public Keyframe { | 13 class StringKeyframe : public Keyframe { |
| 14 public: | 14 public: |
| 15 static PassRefPtr<StringKeyframe> create() { return adoptRef(new StringKeyfr
ame); } | 15 static PassRefPtrWillBeRawPtr<StringKeyframe> create() |
| 16 { |
| 17 return adoptRefWillBeNoop(new StringKeyframe); |
| 18 } |
| 16 void setPropertyValue(CSSPropertyID property, const String& value) | 19 void setPropertyValue(CSSPropertyID property, const String& value) |
| 17 { | 20 { |
| 18 m_propertyValues.add(property, value); | 21 m_propertyValues.add(property, value); |
| 19 } | 22 } |
| 20 void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(pr
operty); } | 23 void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(pr
operty); } |
| 21 String propertyValue(CSSPropertyID property) const | 24 String propertyValue(CSSPropertyID property) const |
| 22 { | 25 { |
| 23 ASSERT(m_propertyValues.contains(property)); | 26 ASSERT(m_propertyValues.contains(property)); |
| 24 return m_propertyValues.get(property); | 27 return m_propertyValues.get(property); |
| 25 } | 28 } |
| 26 virtual PropertySet properties() const OVERRIDE; | 29 virtual PropertySet properties() const OVERRIDE; |
| 27 | 30 |
| 31 virtual void trace(Visitor*) OVERRIDE; |
| 32 |
| 28 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { | 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { |
| 29 public: | 34 public: |
| 30 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const String& value, AnimationEffect::CompositeOperation); | 35 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const String& value, AnimationEffect::CompositeOperation); |
| 31 | 36 |
| 32 const String& value() const { return m_value; } | 37 const String& value() const { return m_value; } |
| 33 | 38 |
| 34 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(d
ouble offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINAL; | 39 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr
alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINA
L; |
| 35 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, Web
Core::Keyframe::PropertySpecificKeyframe* end) const OVERRIDE FINAL; | 40 virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPro
pertyID, WebCore::Keyframe::PropertySpecificKeyframe* end) const OVERRIDE FINAL; |
| 41 |
| 42 virtual void trace(Visitor*) OVERRIDE; |
| 43 |
| 36 private: | 44 private: |
| 37 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const String& value); | 45 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, const String& value); |
| 38 | 46 |
| 39 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(d
ouble offset) const; | 47 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone
WithOffset(double offset) const; |
| 40 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } | 48 virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return
true; } |
| 41 | 49 |
| 42 String m_value; | 50 String m_value; |
| 43 }; | 51 }; |
| 44 | 52 |
| 45 private: | 53 private: |
| 46 StringKeyframe() { } | 54 StringKeyframe() { } |
| 47 | 55 |
| 48 StringKeyframe(const StringKeyframe& copyFrom); | 56 StringKeyframe(const StringKeyframe& copyFrom); |
| 49 | 57 |
| 50 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; | 58 virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE; |
| 51 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecifi
cKeyframe(CSSPropertyID) const OVERRIDE; | 59 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPro
pertySpecificKeyframe(CSSPropertyID) const OVERRIDE; |
| 52 | 60 |
| 53 virtual bool isStringKeyframe() const OVERRIDE { return true; } | 61 virtual bool isStringKeyframe() const OVERRIDE { return true; } |
| 54 | 62 |
| 55 typedef HashMap<CSSPropertyID, String> PropertyValueMap; | 63 typedef HashMap<CSSPropertyID, String> PropertyValueMap; |
| 56 PropertyValueMap m_propertyValues; | 64 PropertyValueMap m_propertyValues; |
| 57 }; | 65 }; |
| 58 | 66 |
| 59 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; | 67 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe; |
| 60 | 68 |
| 61 } | 69 } |
| 62 | 70 |
| 63 #endif | 71 #endif |
| OLD | NEW |