mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:07:35 +00:00
LibWeb: Parse grid-template
property
This commit is contained in:
parent
bebf4363db
commit
22202715fc
13 changed files with 351 additions and 3 deletions
|
@ -37,6 +37,8 @@
|
|||
#include <LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/GridTrackPlacementShorthandStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/GridTrackSizeListShorthandStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ListStyleStyleValue.h>
|
||||
|
@ -623,6 +625,20 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
|||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::GridTemplate) {
|
||||
if (value.is_grid_track_size_list_shorthand()) {
|
||||
auto const& shorthand = value.as_grid_track_size_list_shorthand();
|
||||
style.set_property(CSS::PropertyID::GridTemplateAreas, shorthand.areas());
|
||||
style.set_property(CSS::PropertyID::GridTemplateRows, shorthand.rows());
|
||||
style.set_property(CSS::PropertyID::GridTemplateColumns, shorthand.columns());
|
||||
return;
|
||||
}
|
||||
style.set_property(CSS::PropertyID::GridTemplateAreas, value);
|
||||
style.set_property(CSS::PropertyID::GridTemplateRows, value);
|
||||
style.set_property(CSS::PropertyID::GridTemplateColumns, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::Gap || property_id == CSS::PropertyID::GridGap) {
|
||||
if (value.is_value_list()) {
|
||||
auto const& values_list = value.as_value_list();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue