OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CSSTransformOriginInterpolationType_h |
| 6 #define CSSTransformOriginInterpolationType_h |
| 7 |
| 8 #include "core/animation/CSSLengthInterpolationType.h" |
| 9 #include "core/animation/CSSLengthListInterpolationType.h" |
| 10 #include "core/animation/CSSPositionAxisListInterpolationType.h" |
| 11 #include "core/animation/ListInterpolationFunctions.h" |
| 12 #include "core/css/CSSValueList.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class CSSTransformOriginInterpolationType : public CSSLengthListInterpolationTyp
e { |
| 17 public: |
| 18 CSSTransformOriginInterpolationType(CSSPropertyID property) |
| 19 : CSSLengthListInterpolationType(property) |
| 20 { } |
| 21 |
| 22 private: |
| 23 InterpolationValue maybeConvertValue(const CSSValue& value, const StyleResol
verState&, ConversionCheckers&) const final |
| 24 { |
| 25 const CSSValueList& list = toCSSValueList(value); |
| 26 ASSERT(list.length() == 3); |
| 27 return ListInterpolationFunctions::createList(list.length(), [&list](siz
e_t index) { |
| 28 const CSSValue& item = *list.item(index); |
| 29 if (index < 2) |
| 30 return CSSPositionAxisListInterpolationType::convertPositionAxis
CSSValue(item); |
| 31 return CSSLengthInterpolationType::maybeConvertCSSValue(item); |
| 32 }); |
| 33 } |
| 34 }; |
| 35 |
| 36 } // namespace blink |
| 37 |
| 38 #endif // CSSTransformOriginInterpolationType_h |
OLD | NEW |