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