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 "core/animation/StringKeyframe.h" | 5 #include "core/animation/StringKeyframe.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/animation/ConstantStyleInterpolation.h" | 8 #include "core/animation/ConstantStyleInterpolation.h" |
9 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 9 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
10 #include "core/animation/DoubleStyleInterpolation.h" | 10 #include "core/animation/DoubleStyleInterpolation.h" |
11 #include "core/animation/FilterStyleInterpolation.h" | 11 #include "core/animation/FilterStyleInterpolation.h" |
12 #include "core/animation/ImageSliceStyleInterpolation.h" | 12 #include "core/animation/ImageSliceStyleInterpolation.h" |
13 #include "core/animation/InvalidatableInterpolation.h" | 13 #include "core/animation/InvalidatableInterpolation.h" |
14 #include "core/animation/LegacyStyleInterpolation.h" | 14 #include "core/animation/LegacyStyleInterpolation.h" |
15 #include "core/animation/LengthBoxStyleInterpolation.h" | 15 #include "core/animation/LengthBoxStyleInterpolation.h" |
16 #include "core/animation/LengthPairStyleInterpolation.h" | |
17 #include "core/animation/LengthStyleInterpolation.h" | 16 #include "core/animation/LengthStyleInterpolation.h" |
18 #include "core/animation/ListStyleInterpolation.h" | 17 #include "core/animation/ListStyleInterpolation.h" |
19 #include "core/animation/PropertyInterpolationTypesMapping.h" | 18 #include "core/animation/PropertyInterpolationTypesMapping.h" |
20 #include "core/animation/css/CSSAnimations.h" | 19 #include "core/animation/css/CSSAnimations.h" |
21 #include "core/css/CSSPropertyMetadata.h" | 20 #include "core/css/CSSPropertyMetadata.h" |
22 #include "core/css/resolver/StyleResolver.h" | 21 #include "core/css/resolver/StyleResolver.h" |
23 #include "core/style/ComputedStyle.h" | 22 #include "core/style/ComputedStyle.h" |
24 #include "core/svg/SVGElement.h" | 23 #include "core/svg/SVGElement.h" |
25 #include "platform/RuntimeEnabledFeatures.h" | 24 #include "platform/RuntimeEnabledFeatures.h" |
26 | 25 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // FIXME: Handle keywords e.g. 'smaller', 'larger'. | 167 // FIXME: Handle keywords e.g. 'smaller', 'larger'. |
169 if (property == CSSPropertyFontSize) | 168 if (property == CSSPropertyFontSize) |
170 return createLegacyStyleInterpolation(property, end, element, baseSt
yle); | 169 return createLegacyStyleInterpolation(property, end, element, baseSt
yle); |
171 | 170 |
172 // FIXME: Handle keywords e.g. 'baseline', 'sub'. | 171 // FIXME: Handle keywords e.g. 'baseline', 'sub'. |
173 if (property == CSSPropertyBaselineShift) | 172 if (property == CSSPropertyBaselineShift) |
174 return createLegacyStyleInterpolation(property, end, element, baseSt
yle); | 173 return createLegacyStyleInterpolation(property, end, element, baseSt
yle); |
175 | 174 |
176 break; | 175 break; |
177 | 176 |
178 case CSSPropertyBorderBottomLeftRadius: | |
179 case CSSPropertyBorderBottomRightRadius: | |
180 case CSSPropertyBorderTopLeftRadius: | |
181 case CSSPropertyBorderTopRightRadius: | |
182 if (LengthPairStyleInterpolation::canCreateFrom(*fromCSSValue) && Length
PairStyleInterpolation::canCreateFrom(*toCSSValue)) | |
183 return LengthPairStyleInterpolation::create(*fromCSSValue, *toCSSVal
ue, property, RangeNonNegative); | |
184 break; | |
185 | |
186 case CSSPropertyTransformOrigin: { | 177 case CSSPropertyTransformOrigin: { |
187 RefPtr<Interpolation> interpolation = ListStyleInterpolation<LengthStyle
Interpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property, range)
; | 178 RefPtr<Interpolation> interpolation = ListStyleInterpolation<LengthStyle
Interpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property, range)
; |
188 if (interpolation) | 179 if (interpolation) |
189 return interpolation.release(); | 180 return interpolation.release(); |
190 | 181 |
191 // FIXME: Handle keywords: top, right, left, center, bottom | 182 // FIXME: Handle keywords: top, right, left, center, bottom |
192 return createLegacyStyleInterpolation(property, end, element, baseStyle)
; | 183 return createLegacyStyleInterpolation(property, end, element, baseStyle)
; |
193 } | 184 } |
194 | 185 |
195 case CSSPropertyClip: { | 186 case CSSPropertyClip: { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 278 } |
288 | 279 |
289 PassRefPtr<Interpolation> SVGPropertySpecificKeyframe::maybeCreateInterpolation(
PropertyHandle propertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*
, const ComputedStyle*) const | 280 PassRefPtr<Interpolation> SVGPropertySpecificKeyframe::maybeCreateInterpolation(
PropertyHandle propertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*
, const ComputedStyle*) const |
290 { | 281 { |
291 const InterpolationTypes* applicableTypes = PropertyInterpolationTypesMappin
g::get(propertyHandle); | 282 const InterpolationTypes* applicableTypes = PropertyInterpolationTypesMappin
g::get(propertyHandle); |
292 ASSERT(applicableTypes); | 283 ASSERT(applicableTypes); |
293 return InvalidatableInterpolation::create(propertyHandle, *applicableTypes,
const_cast<SVGPropertySpecificKeyframe*>(this), &end); | 284 return InvalidatableInterpolation::create(propertyHandle, *applicableTypes,
const_cast<SVGPropertySpecificKeyframe*>(this), &end); |
294 } | 285 } |
295 | 286 |
296 } // namespace blink | 287 } // namespace blink |
OLD | NEW |