OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/SVGStrokeDasharrayStyleInterpolation.h" | 6 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
7 | 7 |
8 #include "core/animation/LengthStyleInterpolation.h" | 8 #include "core/animation/LengthStyleInterpolation.h" |
9 #include "core/css/CSSValueList.h" | 9 #include "core/css/CSSValueList.h" |
10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
11 | 11 |
12 #include "wtf/MathExtras.h" | 12 #include "wtf/MathExtras.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 bool isNone(const CSSValue& value) | 18 bool isNone(const CSSValue& value) |
19 { | 19 { |
20 if (!value.isPrimitiveValue()) | 20 if (!value.isPrimitiveValue()) |
21 return false; | 21 return false; |
22 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 22 const CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(value); |
23 return primitiveValue.isValueID() && primitiveValue.getValueID() == CSSValue
None; | 23 return primitiveValue.isValueID() && primitiveValue.getValueID() == CSSValue
None; |
24 } | 24 } |
25 | 25 |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 PassRefPtrWillBeRawPtr<CSSValueList> SVGStrokeDasharrayStyleInterpolation::inter
polableValueToStrokeDasharray(const InterpolableValue& interpolableValue) | 28 PassRefPtrWillBeRawPtr<CSSValueList> SVGStrokeDasharrayStyleInterpolation::inter
polableValueToStrokeDasharray(const InterpolableValue& interpolableValue) |
29 { | 29 { |
30 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); | 30 const InterpolableList& interpolableList = toInterpolableList(interpolableVa
lue); |
31 | 31 |
32 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); | 32 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 return adoptRefWillBeNoop(new SVGStrokeDasharrayStyleInterpolation(interpola
bleStart.release(), interpolableEnd.release(), id)); | 74 return adoptRefWillBeNoop(new SVGStrokeDasharrayStyleInterpolation(interpola
bleStart.release(), interpolableEnd.release(), id)); |
75 } | 75 } |
76 | 76 |
77 void SVGStrokeDasharrayStyleInterpolation::apply(StyleResolverState& state) cons
t | 77 void SVGStrokeDasharrayStyleInterpolation::apply(StyleResolverState& state) cons
t |
78 { | 78 { |
79 StyleBuilder::applyProperty(m_id, state, interpolableValueToStrokeDasharray(
*m_cachedValue)); | 79 StyleBuilder::applyProperty(m_id, state, interpolableValueToStrokeDasharray(
*m_cachedValue)); |
80 } | 80 } |
81 | 81 |
82 } | 82 } |
OLD | NEW |