| 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/LengthBoxStyleInterpolation.h" | 6 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/css/resolver/StyleBuilder.h" | 8 #include "core/css/resolver/StyleBuilder.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 result->set(i, LengthStyleInterpolation::toInterpolableValue(sideCSS
Value)); | 49 result->set(i, LengthStyleInterpolation::toInterpolableValue(sideCSS
Value)); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 return result.release(); | 52 return result.release(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start
, const CSSValue& end) | 55 bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start
, const CSSValue& end) |
| 56 { | 56 { |
| 57 if (!start.isPrimitiveValue() || !end.isPrimitiveValue()) | 57 if (!start.isPrimitiveValue() || !end.isPrimitiveValue()) |
| 58 return false; | 58 return false; |
| 59 const CSSPrimitiveValue startValue = toCSSPrimitiveValue(start); | 59 const CSSPrimitiveValue& startValue = toCSSPrimitiveValue(start); |
| 60 const CSSPrimitiveValue endValue = toCSSPrimitiveValue(end); | 60 const CSSPrimitiveValue& endValue = toCSSPrimitiveValue(end); |
| 61 if ((startValue.isValueID() && startValue.getValueID() == CSSValueAuto) | 61 if ((startValue.isValueID() && startValue.getValueID() == CSSValueAuto) |
| 62 || (endValue.isValueID() && endValue.getValueID() == CSSValueAuto)) | 62 || (endValue.isValueID() && endValue.getValueID() == CSSValueAuto)) |
| 63 return true; | 63 return true; |
| 64 return onlyInterpolateBetweenLengthAndCSSValueAuto(*startValue.getRectValue(
), *endValue.getRectValue()); | 64 return onlyInterpolateBetweenLengthAndCSSValueAuto(*startValue.getRectValue(
), *endValue.getRectValue()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 namespace { | 67 namespace { |
| 68 | 68 |
| 69 CSSPrimitiveValue indexedValueToLength(InterpolableList& lengthBox, size_t i, CS
SPrimitiveValue start[], CSSPrimitiveValue end[]) | 69 CSSPrimitiveValue indexedValueToLength(InterpolableList& lengthBox, size_t i, CS
SPrimitiveValue start[], CSSPrimitiveValue end[]) |
| 70 { | 70 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 DEFINE_TRACE(LengthBoxStyleInterpolation) | 106 DEFINE_TRACE(LengthBoxStyleInterpolation) |
| 107 { | 107 { |
| 108 StyleInterpolation::trace(visitor); | 108 StyleInterpolation::trace(visitor); |
| 109 visitor->trace(m_startCSSValue); | 109 visitor->trace(m_startCSSValue); |
| 110 visitor->trace(m_endCSSValue); | 110 visitor->trace(m_endCSSValue); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } | 113 } |
| OLD | NEW |