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

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

Issue 223443002: [Reland] Web Animations: Introduce String based KeyframeEffectModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@anotherKEMApproach
Patch Set: Created 6 years, 8 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
(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
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModelTest.cpp ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698