Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: Source/core/animation/StringKeyframe.h

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>);
22 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope rty(property); } 23 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope rty(property); }
23 CSSValue* propertyValue(CSSPropertyID property) const 24 CSSValue* propertyValue(CSSPropertyID property) const
24 { 25 {
25 int index = m_propertySet->findPropertyIndex(property); 26 int index = m_propertySet->findPropertyIndex(property);
26 RELEASE_ASSERT(index >= 0); 27 RELEASE_ASSERT(index >= 0);
27 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value(); 28 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value();
28 } 29 }
29 virtual PropertySet properties() const override; 30 virtual PropertySet properties() const override;
30 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const { return m_propertySet; } 31 RefPtrWillBeMember<MutableStylePropertySet> propertySetForInspector() const { return m_propertySet; }
31 32
32 virtual void trace(Visitor*) override; 33 virtual void trace(Visitor*) override;
33 34
34 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { 35 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
35 public: 36 public:
36 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*, AnimationEffect::CompositeOperation); 37 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*, AnimationEffect::CompositeOperation);
37 38
38 CSSValue* value() const { return m_value.get(); } 39 CSSValue* value() const { return m_value.get(); }
40 void setEasing(PassRefPtrWillBeRawPtr<TimingFunction> easing) { m_easing = easing; }
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(); }
42 void setAnimatableValue(PassRefPtr<AnimatableValue>);
40 43
41 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;
42 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;
43 46
44 virtual void trace(Visitor*) override; 47 virtual void trace(Visitor*) override;
45 48
46 private: 49 private:
47 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*); 50 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*);
48 51
49 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone WithOffset(double offset) const; 52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone WithOffset(double offset) const;
(...skipping 23 matching lines...) Expand all
73 }; 76 };
74 77
75 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe; 78 using StringPropertySpecificKeyframe = StringKeyframe::PropertySpecificKeyframe;
76 79
77 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va lue.isStringKeyframe()); 80 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va lue.isStringKeyframe());
78 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());
79 82
80 } 83 }
81 84
82 #endif 85 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698