mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Simplify expansion of background-position shorthand
We know that this is always a `StyleValueList`
This commit is contained in:
parent
40596d5b99
commit
4c4fa5c9cd
Notes:
github-actions[bot]
2025-12-01 10:18:53 +00:00
Author: https://github.com/Calme1709
Commit: 4c4fa5c9cd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6972
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 2 additions and 5 deletions
|
|
@ -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 {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue