1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibWeb: Actually use BorderRadiusShorthandStyleValue

Somehow we were never actually using this before, but parsing the
property as a StyleValueList instead.
This commit is contained in:
Sam Atkins 2022-04-18 17:10:50 +01:00 committed by Andreas Kling
parent 025ee02144
commit ce5914230f
2 changed files with 15 additions and 13 deletions

View file

@ -292,9 +292,12 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
}
if (property_id == CSS::PropertyID::BorderRadius) {
if (value.is_value_list()) {
auto const& values_list = value.as_value_list();
assign_edge_values(PropertyID::BorderTopLeftRadius, PropertyID::BorderTopRightRadius, PropertyID::BorderBottomRightRadius, PropertyID::BorderBottomLeftRadius, values_list.values());
if (value.is_border_radius_shorthand()) {
auto const& shorthand = value.as_border_radius_shorthand();
style.set_property(CSS::PropertyID::BorderTopLeftRadius, shorthand.top_left());
style.set_property(CSS::PropertyID::BorderTopRightRadius, shorthand.top_right());
style.set_property(CSS::PropertyID::BorderBottomRightRadius, shorthand.bottom_right());
style.set_property(CSS::PropertyID::BorderBottomLeftRadius, shorthand.bottom_left());
return;
}