LibWeb: Simplify expansion of background-position shorthand

We know that this is always a `StyleValueList`
This commit is contained in:
Callum Law 2025-11-29 14:43:39 +13:00 committed by Sam Atkins
parent 40596d5b99
commit 4c4fa5c9cd
Notes: github-actions[bot] 2025-12-01 10:18:53 +00:00

View file

@ -620,12 +620,9 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i
return;
}
// FIXME: We should parse BackgroundPosition as a ShorthandStyleValue instead
if (property_id == CSS::PropertyID::BackgroundPosition) {
if (value.is_position()) {
auto const& position = value.as_position();
set_longhand_property(CSS::PropertyID::BackgroundPositionX, position.edge_x());
set_longhand_property(CSS::PropertyID::BackgroundPositionY, position.edge_y());
} else if (value.is_value_list()) {
if (value.is_value_list()) {
// Expand background-position layer list into separate lists for x and y positions:
auto const& values_list = value.as_value_list();
StyleValueVector x_positions {};