Пример #1
0
InterpolationValue CSSClipInterpolationType::maybeConvertUnderlyingValue(
    const InterpolationEnvironment& environment) const {
  if (environment.state().style()->hasAutoClip())
    return nullptr;
  return createClipValue(environment.state().style()->clip(),
                         environment.state().style()->effectiveZoom());
}
InterpolationValue CSSClipInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
    ClipAutos parentAutos = getClipAutos(*state.parentStyle());
    conversionCheckers.append(ParentAutosChecker::create(parentAutos));
    if (parentAutos.isAuto)
        return nullptr;
    return createClipValue(state.parentStyle()->clip(), state.parentStyle()->effectiveZoom());
}
InterpolationValue CSSClipInterpolationType::maybeConvertNeutral(const InterpolationValue& underlying, ConversionCheckers& conversionCheckers) const
{
    ClipAutos underlyingAutos = UnderlyingAutosChecker::getUnderlyingAutos(underlying);
    conversionCheckers.append(UnderlyingAutosChecker::create(underlyingAutos));
    if (underlyingAutos.isAuto)
        return nullptr;
    LengthBox neutralBox(
        underlyingAutos.isTopAuto ? Length(Auto) : Length(0, Fixed),
        underlyingAutos.isRightAuto ? Length(Auto) : Length(0, Fixed),
        underlyingAutos.isBottomAuto ? Length(Auto) : Length(0, Fixed),
        underlyingAutos.isLeftAuto ? Length(Auto) : Length(0, Fixed));
    return createClipValue(neutralBox, 1);
}