Commit 41d85551 authored by alancutter's avatar alancutter Committed by Commit bot

Remove maybeConvertSingle override in CSSValueInterpolationType

This change refactors CSSValueInterpolationType to not override
CSSInterpolationType::maybeConvertSingle() and instead
use the more specific conversion functions as is the norm.

This change is part of supporting smooth interpolation of
registered custom properties. More complex behaviour will be
added to CSSInterpolationType::maybeConvertSingle() which must
be shared with the CSSValueInterpolationType subclass.

There are no changes in behaviour made by this patch.

BUG=671904

Review-Url: https://codereview.chromium.org/2614613002
Cr-Commit-Position: refs/heads/master@{#441885}
parent a4ecd5b7
......@@ -6,6 +6,8 @@
#include "core/animation/InterpolationEnvironment.h"
#include "core/animation/StringKeyframe.h"
#include "core/css/CSSInheritedValue.h"
#include "core/css/CSSInitialValue.h"
#include "core/css/resolver/StyleBuilder.h"
namespace blink {
......@@ -35,22 +37,30 @@ class CSSValueNonInterpolableValue : public NonInterpolableValue {
DEFINE_NON_INTERPOLABLE_VALUE_TYPE(CSSValueNonInterpolableValue);
DEFINE_NON_INTERPOLABLE_VALUE_TYPE_CASTS(CSSValueNonInterpolableValue);
InterpolationValue CSSValueInterpolationType::maybeConvertSingle(
const PropertySpecificKeyframe& keyframe,
const InterpolationEnvironment&,
const InterpolationValue&,
ConversionCheckers&) const {
if (keyframe.isNeutral())
return nullptr;
return InterpolationValue(
InterpolableList::create(0),
CSSValueNonInterpolableValue::create(
toCSSPropertySpecificKeyframe(keyframe).value()));
InterpolationValue CSSValueInterpolationType::maybeConvertInitial(
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
return maybeConvertValue(*CSSInitialValue::create(), state,
conversionCheckers);
}
InterpolationValue CSSValueInterpolationType::maybeConvertInherit(
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
return maybeConvertValue(*CSSInheritedValue::create(), state,
conversionCheckers);
}
InterpolationValue CSSValueInterpolationType::maybeConvertValue(
const CSSValue& value,
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
return InterpolationValue(InterpolableList::create(0),
CSSValueNonInterpolableValue::create(&value));
}
void CSSValueInterpolationType::applyStandardPropertyValue(
const InterpolableValue&,
const InterpolableValue& interpolableValue,
const NonInterpolableValue* nonInterpolableValue,
StyleResolverState& state) const {
StyleBuilder::applyProperty(
......
......@@ -25,39 +25,25 @@ class CSSValueInterpolationType : public CSSInterpolationType {
return nullptr;
}
InterpolationValue maybeConvertSingle(const PropertySpecificKeyframe&,
const InterpolationEnvironment&,
const InterpolationValue& underlying,
ConversionCheckers&) const final;
InterpolationValue maybeConvertStandardPropertyUnderlyingValue(
const StyleResolverState&) const final {
return nullptr;
}
// As we override CSSInterpolationType::maybeConvertSingle, these are never
// called.
InterpolationValue maybeConvertNeutral(const InterpolationValue& underlying,
ConversionCheckers&) const final {
NOTREACHED();
// This type will never interpolate or composite with the underlying value.
// Returning nullptr here means no value will be applied and the value in
// ComputedStyle will remain unchanged.
return nullptr;
}
InterpolationValue maybeConvertInitial(const StyleResolverState&,
ConversionCheckers&) const final {
NOTREACHED();
return nullptr;
}
ConversionCheckers&) const final;
InterpolationValue maybeConvertInherit(const StyleResolverState&,
ConversionCheckers&) const final {
NOTREACHED();
return nullptr;
}
ConversionCheckers&) const final;
InterpolationValue maybeConvertValue(const CSSValue& value,
const StyleResolverState&,
ConversionCheckers&) const final {
NOTREACHED();
return nullptr;
}
ConversionCheckers&) const final;
void composite(UnderlyingValueOwner& underlyingValueOwner,
double underlyingFraction,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment