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

LibWeb: Add place-self css property support

This commit is contained in:
Aliaksandr Kalenik 2023-08-04 14:04:05 +02:00 committed by Andreas Kling
parent f24aab662f
commit da2cd73bcf
12 changed files with 190 additions and 0 deletions

View file

@ -55,6 +55,7 @@
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/PlaceContentStyleValue.h>
#include <LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h>
#include <LibWeb/CSS/StyleValues/PlaceSelfStyleValue.h>
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
#include <LibWeb/CSS/StyleValues/RectStyleValue.h>
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
@ -473,6 +474,19 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return;
}
if (property_id == CSS::PropertyID::PlaceSelf) {
if (value.is_place_self()) {
auto const& place_self = value.as_place_self();
set_longhand_property(CSS::PropertyID::AlignSelf, place_self.align_self());
set_longhand_property(CSS::PropertyID::JustifySelf, place_self.justify_self());
return;
}
set_longhand_property(CSS::PropertyID::AlignSelf, value);
set_longhand_property(CSS::PropertyID::JustifySelf, value);
return;
}
if (property_id == CSS::PropertyID::Border) {
set_property_expanding_shorthands(style, CSS::PropertyID::BorderTop, value, document, declaration, properties_for_revert);
set_property_expanding_shorthands(style, CSS::PropertyID::BorderRight, value, document, declaration, properties_for_revert);