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 #include "config.h" | |
6 #include "core/animation/StringKeyframe.h" | |
7 | |
8 namespace WebCore { | |
9 | |
10 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) | |
11 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) | |
12 { | |
13 for (typename PropertyValueMap::const_iterator iter = copyFrom.m_propertyVal
ues.begin(); iter != copyFrom.m_propertyValues.end(); ++iter) | |
14 setPropertyValue(iter->key, iter->value); | |
15 } | |
16 | |
17 PropertySet StringKeyframe::properties() const | |
18 { | |
19 // This is not used in time-critical code, so we probably don't need to | |
20 // worry about caching this result. | |
21 PropertySet properties; | |
22 for (typename PropertyValueMap::const_iterator iter = m_propertyValues.begin
(); iter != m_propertyValues.end(); ++iter) | |
23 properties.add(*iter.keys()); | |
24 return properties; | |
25 } | |
26 | |
27 PassRefPtrWillBeRawPtr<Keyframe> StringKeyframe::clone() const OVERRIDE | |
28 { | |
29 return adoptRefWillBeNoop(new StringKeyframe(*this)); | |
30 } | |
31 PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::createPropertySpe
cificKeyframe(CSSPropertyID property) const | |
32 { | |
33 return adoptPtr(new PropertySpecificKeyframe(offset(), easing(), propertyVal
ue(property), composite())); | |
34 } | |
35 | |
36 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset
, PassRefPtr<TimingFunction> easing, const String& value, AnimationEffect::Compo
siteOperation op) | |
37 : Keyframe::PropertySpecificKeyframe(offset, easing, op) | |
38 , m_value(value) | |
39 { } | |
40 | |
41 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset
, PassRefPtr<TimingFunction> easing, const String& value) | |
42 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos
iteReplace) | |
43 , m_value(value) | |
44 { | |
45 ASSERT(!isNull(m_offset)); | |
46 } | |
47 | |
48 PassRefPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::createInterp
olation(CSSPropertyID property, Keyframe::PropertySpecificKeyframe* end) const | |
49 { | |
50 ASSERT_UNUSED(end, end); | |
51 // FIXME: Convert string keyframe value pairs to interpolations. | |
52 return nullptr; | |
53 } | |
54 | |
55 PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificK
eyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const | |
56 { | |
57 return adoptPtr(new StringKeyframe::PropertySpecificKeyframe(offset, easing,
emptyString(), AnimationEffect::CompositeAdd)); | |
58 } | |
59 | |
60 PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificK
eyframe::cloneWithOffset(double offset) const | |
61 { | |
62 Keyframe::PropertySpecificKeyframe *theClone = new PropertySpecificKeyframe(
offset, m_easing, m_value); | |
63 return adoptPtr(theClone); | |
64 } | |
65 | |
66 } | |
OLD | NEW |