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/LengthPairStyleInterpolation.h" | 6 #include "core/animation/LengthPairStyleInterpolation.h" |
7 | 7 |
8 #include "core/animation/LengthStyleInterpolation.h" | 8 #include "core/animation/LengthStyleInterpolation.h" |
9 #include "core/css/Pair.h" | 9 #include "core/css/Pair.h" |
10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 ASSERT(pair); | 23 ASSERT(pair); |
24 | 24 |
25 result->set(0, LengthStyleInterpolation::toInterpolableValue(CSSValue(*pair-
>first()))); | 25 result->set(0, LengthStyleInterpolation::toInterpolableValue(CSSValue(*pair-
>first()))); |
26 result->set(1, LengthStyleInterpolation::toInterpolableValue(CSSValue(*pair-
>second()))); | 26 result->set(1, LengthStyleInterpolation::toInterpolableValue(CSSValue(*pair-
>second()))); |
27 return result.release(); | 27 return result.release(); |
28 } | 28 } |
29 | 29 |
30 CSSValue LengthPairStyleInterpolation::interpolableValueToLengthPair(Interpolabl
eValue* value, InterpolationRange range) | 30 CSSValue LengthPairStyleInterpolation::interpolableValueToLengthPair(Interpolabl
eValue* value, InterpolationRange range) |
31 { | 31 { |
32 InterpolableList* lengthPair = toInterpolableList(value); | 32 InterpolableList* lengthPair = toInterpolableList(value); |
33 RefPtrWillBeRawPtr<CSSPrimitiveValue> first = LengthStyleInterpolation::from
InterpolableValue(*lengthPair->get(0), range); | 33 CSSPrimitiveValue first = LengthStyleInterpolation::fromInterpolableValue(*l
engthPair->get(0), range); |
34 RefPtrWillBeRawPtr<CSSPrimitiveValue> second = LengthStyleInterpolation::fro
mInterpolableValue(*lengthPair->get(1), range); | 34 CSSPrimitiveValue second = LengthStyleInterpolation::fromInterpolableValue(*
lengthPair->get(1), range); |
35 RefPtrWillBeRawPtr<Pair> result = Pair::create(first, second, Pair::KeepIden
ticalValues); | 35 RefPtrWillBeRawPtr<Pair> result = Pair::create(first, second, Pair::KeepIden
ticalValues); |
36 | 36 |
37 return CSSPrimitiveValue::create(result.release()); | 37 return CSSPrimitiveValue::create(result.release()); |
38 } | 38 } |
39 | 39 |
40 void LengthPairStyleInterpolation::apply(StyleResolverState& state) const | 40 void LengthPairStyleInterpolation::apply(StyleResolverState& state) const |
41 { | 41 { |
42 StyleBuilder::applyProperty(m_id, state, interpolableValueToLengthPair(m_cac
hedValue.get(), m_range)); | 42 StyleBuilder::applyProperty(m_id, state, interpolableValueToLengthPair(m_cac
hedValue.get(), m_range)); |
43 } | 43 } |
44 | 44 |
45 } // namespace blink | 45 } // namespace blink |
OLD | NEW |