StyleImage* CSSImageInterpolationType::resolveStyleImage( CSSPropertyID property, const InterpolableValue& interpolableValue, const NonInterpolableValue* nonInterpolableValue, StyleResolverState& state) { CSSValue* image = createCSSValue(interpolableValue, nonInterpolableValue); return state.styleImage(property, *image); }
void CSSLengthInterpolationType::apply(const InterpolableValue& interpolableValue, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironment& environment) const { StyleResolverState& state = environment.state(); const InterpolableList& values = toInterpolableList(interpolableValue); bool hasPercentage = CSSLengthNonInterpolableValue::hasPercentage(nonInterpolableValue); if (isPixelsOrPercentOnly(values)) { Length length = resolveInterpolablePixelsOrPercentageLength(values, hasPercentage, m_valueRange, effectiveZoom(*state.style())); if (LengthPropertyFunctions::setLength(cssProperty(), *state.style(), length)) { #if ENABLE(ASSERT) // Assert that setting the length on ComputedStyle directly is identical to the AnimatableValue code path. RefPtr<AnimatableValue> before = CSSAnimatableValueFactory::create(cssProperty(), *state.style()); StyleBuilder::applyProperty(cssProperty(), state, createCSSValue(values, hasPercentage, m_valueRange).get()); RefPtr<AnimatableValue> after = CSSAnimatableValueFactory::create(cssProperty(), *state.style()); ASSERT(before->equals(*after)); #endif return; } } StyleBuilder::applyProperty(cssProperty(), state, createCSSValue(values, hasPercentage, m_valueRange).get()); }