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

LibWeb: Parse grid-column and grid-row CSS values

This commit is contained in:
martinfalisse 2022-08-23 20:00:16 +02:00 committed by Andreas Kling
parent 44d08b81b7
commit 7bb3a8d646
5 changed files with 131 additions and 0 deletions

View file

@ -517,6 +517,32 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::GridColumn) {
if (value.is_grid_track_placement_shorthand()) {
auto const& shorthand = value.as_grid_track_placement_shorthand();
style.set_property(CSS::PropertyID::GridColumnStart, shorthand.start());
style.set_property(CSS::PropertyID::GridColumnEnd, shorthand.end());
return;
}
style.set_property(CSS::PropertyID::GridColumnStart, value);
style.set_property(CSS::PropertyID::GridColumnEnd, value);
return;
}
if (property_id == CSS::PropertyID::GridRow) {
if (value.is_grid_track_placement_shorthand()) {
auto const& shorthand = value.as_grid_track_placement_shorthand();
style.set_property(CSS::PropertyID::GridRowStart, shorthand.start());
style.set_property(CSS::PropertyID::GridRowEnd, shorthand.end());
return;
}
style.set_property(CSS::PropertyID::GridRowStart, value);
style.set_property(CSS::PropertyID::GridRowEnd, value);
return;
}
style.set_property(property_id, value);
}