Truly independent web browser
/*
* Copyright (c) 2025, Sam Atkins <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Format.h>
#include <AK/Optional.h>
#include <AK/Types.h>
#include <AK/Utf16View.h>
namespace Web::CSS {
enum class ValueType : u8 {
Anchor,
AnchorSize,
Angle,
AnglePercentage,
BackgroundPosition,
BasicShape,
Color,
CornerShape,
Counter,
CounterStyle,
CustomIdent,
DashedIdent,
EasingFunction,
FilterValueList,
FitContent,
Flex,
FontStyle,
FontVariantAlternates,
FontVariantEastAsian,
FontVariantLigatures,
FontVariantNumeric,
Frequency,
FrequencyPercentage,
Image,
Integer,
Length,
LengthPercentage,
Number,
OpacityValue,
OpentypeTag,
Paint,
Percentage,
Position,
Ratio,
Rect,
Resolution,
ScrollFunction,
String,
Time,
TimePercentage,
TransformFunction,
TransformList,
Url,
ViewFunction,
ViewTimelineInset
};
StringView value_type_to_string(ValueType);
}
template<>
struct AK::Formatter<Web::CSS::ValueType> : Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::ValueType type)
{
return Formatter<StringView>::format(builder, Web::CSS::value_type_to_string(type));
}
};