| 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 #ifndef ListStyleInterpolation_h | 5 #ifndef ListStyleInterpolation_h |
| 6 #define ListStyleInterpolation_h | 6 #define ListStyleInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/StyleInterpolation.h" | 8 #include "core/animation/StyleInterpolation.h" |
| 9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "core/css/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 InterpolationRange m_range; | 54 InterpolationRange m_range; |
| 55 | 55 |
| 56 Vector<typename InterpolationType::NonInterpolableType> m_nonInterpolableDat
a; | 56 Vector<typename InterpolationType::NonInterpolableType> m_nonInterpolableDat
a; |
| 57 | 57 |
| 58 static PassOwnPtrWillBeRawPtr<InterpolableValue> listToInterpolableValue(con
st CSSValue& value, Vector<typename InterpolationType::NonInterpolableType>* non
InterpolableData = nullptr) | 58 static PassOwnPtrWillBeRawPtr<InterpolableValue> listToInterpolableValue(con
st CSSValue& value, Vector<typename InterpolationType::NonInterpolableType>* non
InterpolableData = nullptr) |
| 59 { | 59 { |
| 60 const CSSValueList& listValue = toCSSValueList(value); | 60 const CSSValueList& listValue = toCSSValueList(value); |
| 61 if (nonInterpolableData) | 61 if (nonInterpolableData) |
| 62 nonInterpolableData->reserveCapacity(listValue.length()); | 62 nonInterpolableData->reserveCapacity(listValue.length()); |
| 63 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(l
istValue.length()); | 63 OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(l
istValue.length()); |
| 64 typename InterpolationType::NonInterpolableType elementData = true; | 64 typename InterpolationType::NonInterpolableType elementData = typename I
nterpolationType::NonInterpolableType(); |
| 65 for (size_t i = 0; i < listValue.length(); i++) { | 65 for (size_t i = 0; i < listValue.length(); i++) { |
| 66 result->set(i, InterpolationType::toInterpolableValue(*listValue.ite
m(i), elementData)); | 66 result->set(i, InterpolationType::toInterpolableValue(*listValue.ite
m(i), elementData)); |
| 67 if (nonInterpolableData) | 67 if (nonInterpolableData) |
| 68 nonInterpolableData->append(elementData); | 68 nonInterpolableData->append(elementData); |
| 69 } | 69 } |
| 70 return result.release(); | 70 return result.release(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToList(Interpolable
Value* value, const Vector<typename InterpolationType::NonInterpolableType>& non
InterpolableData, InterpolationRange range = RangeAll) | 73 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToList(Interpolable
Value* value, const Vector<typename InterpolationType::NonInterpolableType>& non
InterpolableData, InterpolationRange range = RangeAll) |
| 74 { | 74 { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 public: | 148 public: |
| 149 static PassRefPtrWillBeRawPtr<ListStyleInterpolationImpl<InterpolationType,
typename InterpolationType::NonInterpolableType>> maybeCreateFromList(const CSS
Value& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range =
RangeAll) | 149 static PassRefPtrWillBeRawPtr<ListStyleInterpolationImpl<InterpolationType,
typename InterpolationType::NonInterpolableType>> maybeCreateFromList(const CSS
Value& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range =
RangeAll) |
| 150 { | 150 { |
| 151 return ListStyleInterpolationImpl<InterpolationType, typename Interpolat
ionType::NonInterpolableType>::maybeCreateFromList(start, end, id, range); | 151 return ListStyleInterpolationImpl<InterpolationType, typename Interpolat
ionType::NonInterpolableType>::maybeCreateFromList(start, end, id, range); |
| 152 } | 152 } |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace blink | 155 } // namespace blink |
| 156 | 156 |
| 157 #endif // ListStyleInterpolation_h | 157 #endif // ListStyleInterpolation_h |
| OLD | NEW |