| 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 { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 bool onlyInterpolateBetweenLengthAndCSSValueAuto(Rect& startRect, Rect& endRect) | 14 bool onlyInterpolateBetweenLengthAndCSSValueAuto(Rect& startRect, Rect& endRect) |
| 15 { | 15 { |
| 16 return startRect.left()->isLength() != endRect.left()->isLength() | 16 return startRect.left()->isLength() != endRect.left()->isLength() |
| 17 && startRect.right()->isLength() != endRect.right()->isLength() | 17 && startRect.right()->isLength() != endRect.right()->isLength() |
| 18 && startRect.top()->isLength() != endRect.top()->isLength() | 18 && startRect.top()->isLength() != endRect.top()->isLength() |
| 19 && startRect.bottom()->isLength() != endRect.bottom()->isLength(); | 19 && startRect.bottom()->isLength() != endRect.bottom()->isLength(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 PassRefPtrWillBeRawPtr<LengthBoxStyleInterpolation> LengthBoxStyleInterpolation:
:maybeCreateFrom(CSSValue& start, CSSValue& end, CSSPropertyID id) | 24 PassRefPtrWillBeRawPtr<LengthBoxStyleInterpolation> LengthBoxStyleInterpolation:
:maybeCreateFrom(const CSSValue& start, const CSSValue& end, CSSPropertyID id) |
| 25 { | 25 { |
| 26 bool startRect = start.isPrimitiveValue() && toCSSPrimitiveValue(start).isRe
ct(); | 26 bool startRect = start.isPrimitiveValue() && toCSSPrimitiveValue(start).isRe
ct(); |
| 27 bool endRect = end.isPrimitiveValue() && toCSSPrimitiveValue(end).isRect(); | 27 bool endRect = end.isPrimitiveValue() && toCSSPrimitiveValue(end).isRect(); |
| 28 | 28 |
| 29 if (startRect && endRect) | 29 if (startRect && endRect) |
| 30 return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(lengthBoxtoInt
erpolableValue(start, end, false), lengthBoxtoInterpolableValue(end, start, true
), id, start, end)); | 30 return adoptRefWillBeNoop(new LengthBoxStyleInterpolation(lengthBoxtoInt
erpolableValue(start, end, false), lengthBoxtoInterpolableValue(end, start, true
), id, start, end)); |
| 31 return nullptr; | 31 return nullptr; |
| 32 } | 32 } |
| 33 | 33 |
| 34 PassOwnPtrWillBeRawPtr<InterpolableValue> LengthBoxStyleInterpolation::lengthBox
toInterpolableValue(const CSSValue& lengthBox, const CSSValue& matchingValue, bo
ol isEndInterpolation) | 34 PassOwnPtrWillBeRawPtr<InterpolableValue> LengthBoxStyleInterpolation::lengthBox
toInterpolableValue(const CSSValue& lengthBox, const CSSValue& matchingValue, bo
ol isEndInterpolation) |
| (...skipping 69 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 |