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

LibWeb: Parse background-size property

This commit is contained in:
Sam Atkins 2021-11-05 13:44:37 +00:00 committed by Andreas Kling
parent ae2a3bf185
commit 67214e0b61
5 changed files with 71 additions and 0 deletions

View file

@ -418,6 +418,21 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::BackgroundSize) {
if (value.is_value_list()) {
auto& background_size_list = value.as_value_list().values();
// FIXME: Handle multiple backgrounds.
if (!background_size_list.is_empty()) {
auto& background_size = background_size_list.first();
style.set_property(CSS::PropertyID::BackgroundSize, background_size);
}
return;
}
style.set_property(CSS::PropertyID::BackgroundSize, value);
return;
}
if (property_id == CSS::PropertyID::Margin) {
if (value.is_value_list()) {
auto& values_list = value.as_value_list();