1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibWeb: Add parsing for CSS <paint> values

This gets rid of a couple of FIXMEs in Properties.json :^)
This commit is contained in:
Sam Atkins 2023-06-15 16:37:36 +01:00 committed by Andreas Kling
parent 23aae7c7f3
commit 5cdcd135ab
4 changed files with 44 additions and 22 deletions

View file

@ -20,7 +20,7 @@ void generate_bounds_checking_function(JsonObject& properties, SourceGenerator&
static bool type_name_is_enum(StringView type_name)
{
return !AK::first_is_one_of(type_name, "angle"sv, "color"sv, "custom-ident"sv, "frequency"sv, "image"sv, "integer"sv, "length"sv, "number"sv, "percentage"sv, "ratio"sv, "rect"sv, "resolution"sv, "string"sv, "time"sv, "url"sv);
return !AK::first_is_one_of(type_name, "angle"sv, "color"sv, "custom-ident"sv, "frequency"sv, "image"sv, "integer"sv, "length"sv, "number"sv, "paint"sv, "percentage"sv, "ratio"sv, "rect"sv, "resolution"sv, "string"sv, "time"sv, "url"sv);
}
ErrorOr<int> serenity_main(Main::Arguments arguments)
@ -611,6 +611,8 @@ bool property_accepts_type(PropertyID property_id, ValueType value_type)
property_generator.appendln(" case ValueType::Length:");
} else if (type_name == "number") {
property_generator.appendln(" case ValueType::Number:");
} else if (type_name == "paint") {
property_generator.appendln(" case ValueType::Paint:");
} else if (type_name == "percentage") {
property_generator.appendln(" case ValueType::Percentage:");
} else if (type_name == "ratio") {