From cfafb3bf363413d573d2d8afa9d0866ed7c45ad8 Mon Sep 17 00:00:00 2001 From: Callum Law Date: Thu, 10 Jul 2025 03:04:13 +1200 Subject: [PATCH] LibWeb: Remove unused code in `for_each_property_expanding_shorthands` This case is already handled by this point as `value` is a shorthand. No functionality changes. --- Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp | 1 + Libraries/LibWeb/CSS/StyleComputer.cpp | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index b7b1954122b..4cfc3963706 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -1647,6 +1647,7 @@ RefPtr Parser::parse_border_value(PropertyID property_id, T if (!border_color) border_color = property_initial_value(color_property); + // FIXME: Also reset border-image, in line with the spec: https://www.w3.org/TR/css-backgrounds-3/#border-shorthands transaction.commit(); return ShorthandStyleValue::create(property_id, { width_property, style_property, color_property }, diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 027fdf7837e..7c7c45b9518 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -681,15 +681,6 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i } }; - if (property_id == CSS::PropertyID::Border) { - for_each_property_expanding_shorthands(CSS::PropertyID::BorderTop, value, set_longhand_property); - for_each_property_expanding_shorthands(CSS::PropertyID::BorderRight, value, set_longhand_property); - for_each_property_expanding_shorthands(CSS::PropertyID::BorderBottom, value, set_longhand_property); - for_each_property_expanding_shorthands(CSS::PropertyID::BorderLeft, value, set_longhand_property); - // FIXME: Also reset border-image, in line with the spec: https://www.w3.org/TR/css-backgrounds-3/#border-shorthands - return; - } - if (property_id == CSS::PropertyID::BorderStyle) { assign_edge_values(PropertyID::BorderTopStyle, PropertyID::BorderRightStyle, PropertyID::BorderBottomStyle, PropertyID::BorderLeftStyle, value); return;