mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibWeb: Parse rect style value
Add ability to parse a rect when it is used as the value of a style property.
This commit is contained in:
@@ -501,6 +501,11 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value)
|
||||
output_numeric_value_check(property_generator, "has_number"sv, "to_number()"sv, Array { "Integer"sv, "Number"sv }, min_value, max_value);
|
||||
} else if (type_name == "percentage") {
|
||||
output_numeric_value_check(property_generator, "is_percentage"sv, "as_percentage().percentage().value()"sv, Array { "Percentage"sv }, min_value, max_value);
|
||||
} else if (type_name == "rect") {
|
||||
property_generator.append(R"~~~(
|
||||
if (style_value.has_rect())
|
||||
return true;
|
||||
)~~~");
|
||||
} else if (type_name == "resolution") {
|
||||
output_numeric_value_check(property_generator, "is_resolution"sv, "as_resolution().resolution().to_dots_per_pixel()"sv, Array<StringView, 0> {}, min_value, max_value);
|
||||
} else if (type_name == "string") {
|
||||
|
||||
Reference in New Issue
Block a user