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