1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Parse grid-area CSS property

This commit is contained in:
martinfalisse 2023-01-16 19:02:39 +01:00 committed by Andreas Kling
parent a6548c4d80
commit 9bc001f410
10 changed files with 220 additions and 0 deletions

View file

@ -520,6 +520,22 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::GridArea) {
if (value.is_grid_area_shorthand()) {
auto const& shorthand = value.as_grid_area_shorthand();
style.set_property(CSS::PropertyID::GridRowStart, shorthand.row_start());
style.set_property(CSS::PropertyID::GridColumnStart, shorthand.column_start());
style.set_property(CSS::PropertyID::GridRowEnd, shorthand.row_end());
style.set_property(CSS::PropertyID::GridColumnEnd, shorthand.column_end());
return;
}
style.set_property(CSS::PropertyID::GridRowStart, value);
style.set_property(CSS::PropertyID::GridColumnStart, value);
style.set_property(CSS::PropertyID::GridRowEnd, value);
style.set_property(CSS::PropertyID::GridColumnEnd, value);
return;
}
if (property_id == CSS::PropertyID::GridColumn) {
if (value.is_grid_track_placement_shorthand()) {
auto const& shorthand = value.as_grid_track_placement_shorthand();