mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibWeb: Add support for "place-items" CSS property
Adds support for place-items property which allows to specify both align-items and justify-items in a single declaration.
This commit is contained in:
committed by
Andreas Kling
parent
a74c56bc1b
commit
a8587fe54e
@@ -54,6 +54,7 @@
|
||||
#include <LibWeb/CSS/StyleValues/OverflowStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PlaceContentStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/RectStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
|
||||
@@ -432,6 +433,19 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
||||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::PlaceItems) {
|
||||
if (value.is_place_items()) {
|
||||
auto const& place_items = value.as_place_items();
|
||||
style.set_property(CSS::PropertyID::AlignItems, place_items.align_items());
|
||||
style.set_property(CSS::PropertyID::JustifyItems, place_items.justify_items());
|
||||
return;
|
||||
}
|
||||
|
||||
style.set_property(CSS::PropertyID::AlignItems, value);
|
||||
style.set_property(CSS::PropertyID::JustifyItems, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::Border) {
|
||||
set_property_expanding_shorthands(style, CSS::PropertyID::BorderTop, value, document, declaration);
|
||||
set_property_expanding_shorthands(style, CSS::PropertyID::BorderRight, value, document, declaration);
|
||||
|
||||
Reference in New Issue
Block a user