| Index: third_party/WebKit/Source/core/animation/CSSResolutionInterpolationType.cpp
|
| diff --git a/third_party/WebKit/Source/core/animation/CSSResolutionInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSResolutionInterpolationType.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4dd92818739b3aa2569208be19731d468b35acd6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/animation/CSSResolutionInterpolationType.cpp
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "core/animation/CSSResolutionInterpolationType.h"
|
| +
|
| +#include "core/css/CSSPrimitiveValue.h"
|
| +
|
| +namespace blink {
|
| +
|
| +InterpolationValue CSSResolutionInterpolationType::MaybeConvertNeutral(
|
| + const InterpolationValue&,
|
| + ConversionCheckers&) const {
|
| + return InterpolationValue(InterpolableNumber::Create(0));
|
| +}
|
| +
|
| +InterpolationValue CSSResolutionInterpolationType::MaybeConvertValue(
|
| + const CSSValue& value,
|
| + const StyleResolverState*,
|
| + ConversionCheckers&) const {
|
| + if (!value.IsPrimitiveValue() ||
|
| + !CSSPrimitiveValue::IsResolution(
|
| + ToCSSPrimitiveValue(value).TypeWithCalcResolved()))
|
| + return nullptr;
|
| + return InterpolationValue(InterpolableNumber::Create(
|
| + ToCSSPrimitiveValue(value).ComputeDotsPerPixel()));
|
| +}
|
| +
|
| +const CSSValue* CSSResolutionInterpolationType::CreateCSSValue(
|
| + const InterpolableValue& value,
|
| + const NonInterpolableValue*,
|
| + const StyleResolverState&) const {
|
| + return CSSPrimitiveValue::Create(ToInterpolableNumber(value).Value(),
|
| + CSSPrimitiveValue::UnitType::kDotsPerPixel);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|