1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

LibWeb: Add support for parsing 'inset' shorthand CSS property

This commit is contained in:
FalseHonesty 2023-05-29 21:43:37 -04:00 committed by Andreas Kling
parent e129c8049b
commit cabfb7867c
4 changed files with 72 additions and 0 deletions

View file

@ -516,6 +516,20 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::Inset) {
if (value.is_value_list()) {
auto const& values_list = value.as_value_list();
assign_edge_values(PropertyID::Top, PropertyID::Right, PropertyID::Bottom, PropertyID::Left, values_list.values());
return;
}
style.set_property(CSS::PropertyID::Top, value, declaration);
style.set_property(CSS::PropertyID::Right, value, declaration);
style.set_property(CSS::PropertyID::Bottom, value, declaration);
style.set_property(CSS::PropertyID::Left, value, declaration);
return;
}
if (property_id == CSS::PropertyID::Margin) {
if (value.is_value_list()) {
auto const& values_list = value.as_value_list();