1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

LibWeb: Store computed CSS value of background-repeat

This commit is contained in:
Timothy Flynn 2021-04-02 15:41:29 -04:00 committed by Andreas Kling
parent fcfeadaffa
commit bd5a91269f
7 changed files with 55 additions and 0 deletions

View file

@ -429,6 +429,8 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
style.set_property(CSS::PropertyID::BackgroundColor, values[0]);
for (auto& value : values) {
if (value.is_identifier())
set_property_expanding_shorthands(style, CSS::PropertyID::BackgroundRepeat, value, document);
if (!value.is_string())
continue;
auto string = value.to_string();
@ -456,6 +458,11 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::BackgroundRepeat) {
style.set_property(CSS::PropertyID::BackgroundRepeat, value);
return;
}
if (property_id == CSS::PropertyID::Margin) {
if (value.is_length()) {
style.set_property(CSS::PropertyID::MarginTop, value);