#include "third_party/blink/renderer/core/animation/interpolable_length.h"
#include "third_party/blink/renderer/core/animation/length_property_functions.h"
#include "third_party/blink/renderer/core/animation/underlying_value.h"
#include "third_party/blink/renderer/core/css/css_math_expression_node.h"
#include "third_party/blink/renderer/core/css/css_math_function_value.h"
#include "third_party/blink/renderer/core/css/css_math_operator.h"
#include "third_party/blink/renderer/core/css/css_numeric_literal_value.h"
#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h"
#include "third_party/blink/renderer/core/css/css_value_clamping_utils.h"
#include "third_party/blink/renderer/platform/geometry/blend.h"
#include "third_party/blink/renderer/platform/geometry/calculation_value.h"
namespace blink {
UnitType;
namespace {
CSSMathExpressionNode* NumberNode(double number) { … }
CSSMathExpressionNode* PercentageNode(double number) { … }
}
InterpolableLength* InterpolableLength::CreatePixels(double pixels) { … }
InterpolableLength* InterpolableLength::CreatePercent(double percent) { … }
InterpolableLength* InterpolableLength::CreateNeutral() { … }
InterpolableLength* InterpolableLength::MaybeConvertCSSValue(
const CSSValue& value) { … }
CSSValueID InterpolableLength::LengthTypeToCSSValueID(Length::Type lt) { … }
Length::Type InterpolableLength::CSSValueIDToLengthType(CSSValueID id) { … }
InterpolableLength* InterpolableLength::MaybeConvertLength(
const Length& length,
const CSSProperty& property,
float zoom,
std::optional<EInterpolateSize> interpolate_size) { … }
bool InterpolableLength::IsCalcSize() const { … }
namespace {
const CSSMathExpressionNode& ExtractCalcSizeBasis(
const CSSMathExpressionNode* node) { … }
}
bool InterpolableLength::CanMergeValues(const InterpolableValue* start,
const InterpolableValue* end) { … }
PairwiseInterpolationValue InterpolableLength::MaybeMergeSingles(
InterpolableValue* start,
InterpolableValue* end) { … }
InterpolableLength::InterpolableLength(CSSLengthArray&& length_array) { … }
void InterpolableLength::SetLengthArray(CSSLengthArray&& length_array) { … }
InterpolableLength::InterpolableLength(
const CSSMathExpressionNode& expression) { … }
void InterpolableLength::SetExpression(
const CSSMathExpressionNode& expression) { … }
InterpolableLength::InterpolableLength(
CSSValueID keyword,
std::optional<EInterpolateSize> interpolate_size) { … }
void InterpolableLength::SetKeyword(
CSSValueID keyword,
std::optional<EInterpolateSize> interpolate_size) { … }
void InterpolableLength::SetInterpolateSize(EInterpolateSize interpolate_size) { … }
InterpolableLength* InterpolableLength::RawClone() const { … }
bool InterpolableLength::HasPercentage() const { … }
void InterpolableLength::SetHasPercentage() { … }
void InterpolableLength::SubtractFromOneHundredPercent() { … }
static double ClampToRange(double x, Length::ValueRange range) { … }
static const CSSNumericLiteralValue& ClampNumericLiteralValueToRange(
const CSSNumericLiteralValue& value,
CSSPrimitiveValue::ValueRange range) { … }
static UnitType IndexToUnitType(wtf_size_t index) { … }
Length InterpolableLength::CreateLength(
const CSSToLengthConversionData& conversion_data,
Length::ValueRange range) const { … }
const CSSPrimitiveValue* InterpolableLength::CreateCSSValue(
Length::ValueRange range) const { … }
const CSSMathExpressionNode& InterpolableLength::AsExpression() const { … }
void InterpolableLength::Scale(double scale) { … }
void InterpolableLength::Add(const InterpolableValue& other) { … }
void InterpolableLength::ScaleAndAdd(double scale,
const InterpolableValue& other) { … }
void InterpolableLength::AssertCanInterpolateWith(
const InterpolableValue& other) const { … }
void InterpolableLength::Interpolate(const InterpolableValue& to,
const double progress,
InterpolableValue& result) const { … }
void InterpolableLength::Trace(Visitor* v) const { … }
}