summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-04-18 17:10:50 +0100
committerAndreas Kling <kling@serenityos.org>2022-04-18 21:30:51 +0200
commitce5914230f25155171bd2510f5f82983e856b554 (patch)
tree33055ab7f6adf7fa20f029efbe55e3cc6ecccb20 /Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
parent025ee021448e37c54e286737ee45ff81a831309e (diff)
downloadserenity-ce5914230f25155171bd2510f5f82983e856b554.zip
LibWeb: Actually use BorderRadiusShorthandStyleValue
Somehow we were never actually using this before, but parsing the property as a StyleValueList instead.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index 07d970d6a3..bf5dde38c0 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -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;
}