mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Replace PlaceItemsStyleValue with ShorthandStyleValue
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/6e311902de Pull-request: https://github.com/SerenityOS/serenity/pull/21168
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user