| OLD | NEW |
| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
| 7 | 7 |
| 8 #include "core/animation/ColorStyleInterpolation.h" | 8 #include "core/animation/ColorStyleInterpolation.h" |
| 9 #include "core/animation/CompositorAnimations.h" | 9 #include "core/animation/CompositorAnimations.h" |
| 10 #include "core/animation/ConstantStyleInterpolation.h" | 10 #include "core/animation/ConstantStyleInterpolation.h" |
| 11 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 11 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 12 #include "core/animation/DoubleStyleInterpolation.h" | 12 #include "core/animation/DoubleStyleInterpolation.h" |
| 13 #include "core/animation/ImageSliceStyleInterpolation.h" | 13 #include "core/animation/ImageSliceStyleInterpolation.h" |
| 14 #include "core/animation/ImageStyleInterpolation.h" | 14 #include "core/animation/ImageStyleInterpolation.h" |
| 15 #include "core/animation/LegacyStyleInterpolation.h" | 15 #include "core/animation/LegacyStyleInterpolation.h" |
| 16 #include "core/animation/LengthBoxStyleInterpolation.h" | 16 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 17 #include "core/animation/LengthPairStyleInterpolation.h" | 17 #include "core/animation/LengthPairStyleInterpolation.h" |
| 18 #include "core/animation/LengthStyleInterpolation.h" | 18 #include "core/animation/LengthStyleInterpolation.h" |
| 19 #include "core/animation/ListStyleInterpolation.h" | 19 #include "core/animation/ListStyleInterpolation.h" |
| 20 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 20 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
| 21 #include "core/animation/ShadowStyleInterpolation.h" | 21 #include "core/animation/ShadowStyleInterpolation.h" |
| 22 #include "core/animation/VisibilityStyleInterpolation.h" | 22 #include "core/animation/VisibilityStyleInterpolation.h" |
| 23 #include "core/animation/css/CSSAnimations.h" | 23 #include "core/animation/css/CSSAnimations.h" |
| 24 #include "core/css/CSSPropertyMetadata.h" | 24 #include "core/css/CSSPropertyMetadata.h" |
| 25 #include "core/css/resolver/StyleResolver.h" | 25 #include "core/css/resolver/StyleResolver.h" |
| 26 #include "core/layout/style/LayoutStyle.h" | 26 #include "core/layout/style/ComputedStyle.h" |
| 27 | 27 |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) | 30 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) |
| 31 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) | 31 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) |
| 32 , m_propertySet(copyFrom.m_propertySet->mutableCopy()) | 32 , m_propertySet(copyFrom.m_propertySet->mutableCopy()) |
| 33 { | 33 { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu
e, StyleSheetContents* styleSheetContents) | 36 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu
e, StyleSheetContents* styleSheetContents) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 , m_value(value) | 77 , m_value(value) |
| 78 { } | 78 { } |
| 79 | 79 |
| 80 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset
, PassRefPtr<TimingFunction> easing, CSSValue* value) | 80 StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset
, PassRefPtr<TimingFunction> easing, CSSValue* value) |
| 81 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos
iteReplace) | 81 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos
iteReplace) |
| 82 , m_value(value) | 82 , m_value(value) |
| 83 { | 83 { |
| 84 ASSERT(!isNull(m_offset)); | 84 ASSERT(!isNull(m_offset)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void StringKeyframe::PropertySpecificKeyframe::populateAnimatableValue(CSSProper
tyID property, Element& element, const LayoutStyle* baseStyle) const | 87 void StringKeyframe::PropertySpecificKeyframe::populateAnimatableValue(CSSProper
tyID property, Element& element, const ComputedStyle* baseStyle) const |
| 88 { | 88 { |
| 89 if (!m_animatableValueCache && (baseStyle || !m_value->isInheritedValue())) | 89 if (!m_animatableValueCache && (baseStyle || !m_value->isInheritedValue())) |
| 90 m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(el
ement, baseStyle, property, m_value.get()); | 90 m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(el
ement, baseStyle, property, m_value.get()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 namespace { | 93 namespace { |
| 94 InterpolationRange setRange(CSSPropertyID id) | 94 InterpolationRange setRange(CSSPropertyID id) |
| 95 { | 95 { |
| 96 switch (id) { | 96 switch (id) { |
| 97 case CSSPropertyOrphans: | 97 case CSSPropertyOrphans: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 return RangeNonNegative; | 115 return RangeNonNegative; |
| 116 default: | 116 default: |
| 117 ASSERT_NOT_REACHED(); | 117 ASSERT_NOT_REACHED(); |
| 118 return RangeAll; | 118 return RangeAll; |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace | 122 } // namespace |
| 123 | 123 |
| 124 // FIXME: Refactor this into a generic piece that lives in InterpolationEffect,
and a template parameter specific converter. | 124 // FIXME: Refactor this into a generic piece that lives in InterpolationEffect,
and a template parameter specific converter. |
| 125 PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
maybeCreateInterpolation(CSSPropertyID property, Keyframe::PropertySpecificKeyfr
ame& end, Element* element, const LayoutStyle* baseStyle) const | 125 PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
maybeCreateInterpolation(CSSPropertyID property, Keyframe::PropertySpecificKeyfr
ame& end, Element* element, const ComputedStyle* baseStyle) const |
| 126 { | 126 { |
| 127 CSSValue* fromCSSValue = m_value.get(); | 127 CSSValue* fromCSSValue = m_value.get(); |
| 128 CSSValue* toCSSValue = toStringPropertySpecificKeyframe(end).value(); | 128 CSSValue* toCSSValue = toStringPropertySpecificKeyframe(end).value(); |
| 129 InterpolationRange range = RangeAll; | 129 InterpolationRange range = RangeAll; |
| 130 bool fallBackToLegacy = false; | 130 bool fallBackToLegacy = false; |
| 131 | 131 |
| 132 // FIXME: Remove this flag once we can rely on legacy's behaviour being corr
ect. | 132 // FIXME: Remove this flag once we can rely on legacy's behaviour being corr
ect. |
| 133 bool forceDefaultInterpolation = false; | 133 bool forceDefaultInterpolation = false; |
| 134 | 134 |
| 135 // FIXME: Remove this check once neutral keyframes are implemented in String
Keyframes. | 135 // FIXME: Remove this check once neutral keyframes are implemented in String
Keyframes. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 | 407 |
| 408 DEFINE_TRACE(StringKeyframe::PropertySpecificKeyframe) | 408 DEFINE_TRACE(StringKeyframe::PropertySpecificKeyframe) |
| 409 { | 409 { |
| 410 visitor->trace(m_value); | 410 visitor->trace(m_value); |
| 411 visitor->trace(m_animatableValueCache); | 411 visitor->trace(m_animatableValueCache); |
| 412 Keyframe::PropertySpecificKeyframe::trace(visitor); | 412 Keyframe::PropertySpecificKeyframe::trace(visitor); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } | 415 } |
| OLD | NEW |