1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:27:42 +00:00

LibWeb: Replace PlaceItemsStyleValue with ShorthandStyleValue

This commit is contained in:
Sam Atkins 2023-09-20 15:30:36 +01:00 committed by Sam Atkins
parent 8143d48161
commit 6e311902de
10 changed files with 13 additions and 78 deletions

View file

@ -61,7 +61,6 @@
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
#include <LibWeb/CSS/StyleValues/OverflowStyleValue.h>
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/PlaceItemsStyleValue.h>
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
#include <LibWeb/CSS/StyleValues/RatioStyleValue.h>
#include <LibWeb/CSS/StyleValues/RectStyleValue.h>
@ -4602,13 +4601,17 @@ RefPtr<StyleValue> Parser::parse_place_items_value(Vector<ComponentValue> const&
if (component_values.size() == 1) {
if (!property_accepts_identifier(PropertyID::JustifyItems, maybe_align_items_value->to_identifier()))
return nullptr;
return PlaceItemsStyleValue::create(*maybe_align_items_value, *maybe_align_items_value);
return ShorthandStyleValue::create(PropertyID::PlaceItems,
{ PropertyID::AlignItems, PropertyID::JustifyItems },
{ *maybe_align_items_value, *maybe_align_items_value });
}
auto maybe_justify_items_value = parse_css_value_for_property(PropertyID::JustifyItems, tokens);
if (!maybe_justify_items_value)
return nullptr;
return PlaceItemsStyleValue::create(*maybe_align_items_value, *maybe_justify_items_value);
return ShorthandStyleValue::create(PropertyID::PlaceItems,
{ PropertyID::AlignItems, PropertyID::JustifyItems },
{ *maybe_align_items_value, *maybe_justify_items_value });
}
RefPtr<StyleValue> Parser::parse_place_self_value(Vector<ComponentValue> const& component_values)