| 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/LengthStyleInterpolation.h" | 6 #include "core/animation/LengthStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/animation/css/CSSAnimatableValueFactory.h" | 8 #include "core/animation/css/CSSAnimatableValueFactory.h" |
| 9 #include "core/css/CSSCalculationValue.h" | 9 #include "core/css/CSSCalculationValue.h" |
| 10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 static CSSPrimitiveValue::UnitType toUnitType(int lengthUnitType) | 201 static CSSPrimitiveValue::UnitType toUnitType(int lengthUnitType) |
| 202 { | 202 { |
| 203 return static_cast<CSSPrimitiveValue::UnitType>(CSSPrimitiveValue::lengthUni
tTypeToUnitType(static_cast<CSSPrimitiveValue::LengthUnitType>(lengthUnitType)))
; | 203 return static_cast<CSSPrimitiveValue::UnitType>(CSSPrimitiveValue::lengthUni
tTypeToUnitType(static_cast<CSSPrimitiveValue::LengthUnitType>(lengthUnitType)))
; |
| 204 } | 204 } |
| 205 | 205 |
| 206 static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> constructCalcExpression(con
st InterpolableList* list) | 206 static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> constructCalcExpression(con
st InterpolableList* list) |
| 207 { | 207 { |
| 208 const InterpolableList* listOfValues = toInterpolableList(list->get(0)); | 208 const InterpolableList* listOfValues = toInterpolableList(list->get(0)); |
| 209 const InterpolableList* listOfTypes = toInterpolableList(list->get(1)); | 209 const InterpolableList* listOfTypes = toInterpolableList(list->get(1)); |
| 210 RefPtrWillBeRawPtr<CSSCalcExpressionNode> expression; | 210 RefPtrWillBeRawPtr<CSSCalcExpressionNode> expression = nullptr; |
| 211 for (size_t position = 0; position < CSSPrimitiveValue::LengthUnitTypeCount;
position++) { | 211 for (size_t position = 0; position < CSSPrimitiveValue::LengthUnitTypeCount;
position++) { |
| 212 const InterpolableNumber *subValueType = toInterpolableNumber(listOfType
s->get(position)); | 212 const InterpolableNumber *subValueType = toInterpolableNumber(listOfType
s->get(position)); |
| 213 if (!subValueType->value()) | 213 if (!subValueType->value()) |
| 214 continue; | 214 continue; |
| 215 double value = toInterpolableNumber(listOfValues->get(position))->value(
); | 215 double value = toInterpolableNumber(listOfValues->get(position))->value(
); |
| 216 RefPtrWillBeRawPtr<CSSCalcExpressionNode> currentTerm = CSSCalcValue::cr
eateExpressionNode(CSSPrimitiveValue::create(value, toUnitType(position))); | 216 RefPtrWillBeRawPtr<CSSCalcExpressionNode> currentTerm = CSSCalcValue::cr
eateExpressionNode(CSSPrimitiveValue::create(value, toUnitType(position))); |
| 217 if (expression) | 217 if (expression) |
| 218 expression = CSSCalcValue::createExpressionNode(expression.release()
, currentTerm.release(), CalcAdd); | 218 expression = CSSCalcValue::createExpressionNode(expression.release()
, currentTerm.release(), CalcAdd); |
| 219 else | 219 else |
| 220 expression = currentTerm.release(); | 220 expression = currentTerm.release(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cached
Value, m_range).get()); | 301 StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cached
Value, m_range).get()); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 DEFINE_TRACE(LengthStyleInterpolation) | 305 DEFINE_TRACE(LengthStyleInterpolation) |
| 306 { | 306 { |
| 307 StyleInterpolation::trace(visitor); | 307 StyleInterpolation::trace(visitor); |
| 308 } | 308 } |
| 309 | 309 |
| 310 } | 310 } |
| OLD | NEW |