1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:47:45 +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

@ -1151,6 +1151,24 @@
"image-rendering"
]
},
"inset": {
"inherited": false,
"initial": "auto",
"longhands": [
"top",
"right",
"bottom",
"left"
],
"max-values": 4,
"valid-types": [
"length",
"percentage"
],
"valid-identifiers": [
"auto"
]
},
"justify-content": {
"inherited": false,
"initial": "flex-start",

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();