mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibWeb: Parse background-size
property
This commit is contained in:
parent
ae2a3bf185
commit
67214e0b61
Notes:
sideshowbarker
2024-07-18 01:20:27 +09:00
Author: https://github.com/AtkinsSJ
Commit: 67214e0b61
Pull-request: https://github.com/SerenityOS/serenity/pull/10844
Reviewed-by: https://github.com/awesomekling
5 changed files with 71 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue