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/ShadowStyleInterpolation.h" | 6 #include "core/animation/ShadowStyleInterpolation.h" |
7 | 7 |
8 #include "core/animation/ColorStyleInterpolation.h" | 8 #include "core/animation/ColorStyleInterpolation.h" |
9 #include "core/animation/LengthStyleInterpolation.h" | 9 #include "core/animation/LengthStyleInterpolation.h" |
10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 result->set(0, lengthToInterpolableValue(shadowValue.x)); | 36 result->set(0, lengthToInterpolableValue(shadowValue.x)); |
37 result->set(1, lengthToInterpolableValue(shadowValue.y)); | 37 result->set(1, lengthToInterpolableValue(shadowValue.y)); |
38 result->set(2, lengthToInterpolableValue(shadowValue.blur)); | 38 result->set(2, lengthToInterpolableValue(shadowValue.blur)); |
39 result->set(3, lengthToInterpolableValue(shadowValue.spread)); | 39 result->set(3, lengthToInterpolableValue(shadowValue.spread)); |
40 | 40 |
41 if (shadowValue.color && ColorStyleInterpolation::canCreateFrom(CSSValue(*sh
adowValue.color.get()))) | 41 if (shadowValue.color && ColorStyleInterpolation::canCreateFrom(CSSValue(*sh
adowValue.color.get()))) |
42 result->set(4, ColorStyleInterpolation::colorToInterpolableValue(CSSValu
e(*shadowValue.color.get()))); | 42 result->set(4, ColorStyleInterpolation::colorToInterpolableValue(CSSValu
e(*shadowValue.color.get()))); |
43 | 43 |
44 if (shadowValue.style) | 44 if (shadowValue.style) |
45 nonInterpolableData = (toCSSPrimitiveValue(*shadowValue.style).getValueI
D() == CSSValueInset); | 45 nonInterpolableData = (toCSSPrimitiveValue(shadowValue.style).getValueID
() == CSSValueInset); |
46 else | 46 else |
47 nonInterpolableData = false; | 47 nonInterpolableData = false; |
48 | 48 |
49 return result.release(); | 49 return result.release(); |
50 } | 50 } |
51 | 51 |
52 CSSValue ShadowStyleInterpolation::fromInterpolableValue(const InterpolableValue
& value, NonInterpolableType nonInterpolableData, InterpolationRange range) | 52 CSSValue ShadowStyleInterpolation::fromInterpolableValue(const InterpolableValue
& value, NonInterpolableType nonInterpolableData, InterpolationRange range) |
53 { | 53 { |
54 const InterpolableList* shadow = toInterpolableList(&value); | 54 const InterpolableList* shadow = toInterpolableList(&value); |
55 CSSPrimitiveValue x = LengthStyleInterpolation::fromInterpolableValue(*shado
w->get(0), RangeAll); | 55 CSSPrimitiveValue x = LengthStyleInterpolation::fromInterpolableValue(*shado
w->get(0), RangeAll); |
(...skipping 16 matching lines...) Expand all Loading... |
72 for (size_t i = 0; i < toCSSValueList(start).length(); i++) { | 72 for (size_t i = 0; i < toCSSValueList(start).length(); i++) { |
73 if (startList.item(i).isShadowValue() && endList.item(i).isShadowVal
ue() | 73 if (startList.item(i).isShadowValue() && endList.item(i).isShadowVal
ue() |
74 && toCSSShadowValue(startList.item(i)).style != toCSSShadowValue
(endList.item(i)).style) | 74 && toCSSShadowValue(startList.item(i)).style != toCSSShadowValue
(endList.item(i)).style) |
75 return true; | 75 return true; |
76 } | 76 } |
77 } | 77 } |
78 return false; | 78 return false; |
79 } | 79 } |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
OLD | NEW |