mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Parse grid-template
property
This commit is contained in:
parent
bebf4363db
commit
22202715fc
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/martinfalisse
Commit: 22202715fc
Pull-request: https://github.com/SerenityOS/serenity/pull/18575
Issue: https://github.com/SerenityOS/serenity/issues/18507
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