diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp index 32d19ce176..a08b5c03ed 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceContentStyleValue.cpp @@ -10,7 +10,11 @@ namespace Web::CSS { ErrorOr PlaceContentStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.align_content->to_string()), TRY(m_properties.justify_content->to_string())); + auto align_content = TRY(m_properties.align_content->to_string()); + auto justify_content = TRY(m_properties.justify_content->to_string()); + if (align_content == justify_content) + return String::formatted("{}", align_content); + return String::formatted("{} {}", align_content, justify_content); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp index efe0187bea..dfa988116a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceItemsStyleValue.cpp @@ -10,7 +10,11 @@ namespace Web::CSS { ErrorOr PlaceItemsStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.align_items->to_string()), TRY(m_properties.justify_items->to_string())); + auto align_items = TRY(m_properties.align_items->to_string()); + auto justify_items = TRY(m_properties.justify_items->to_string()); + if (align_items == justify_items) + return String::formatted("{}", align_items); + return String::formatted("{} {}", align_items, justify_items); } } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp index e00e29dd63..4f1290cd42 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/PlaceSelfStyleValue.cpp @@ -10,7 +10,11 @@ namespace Web::CSS { ErrorOr PlaceSelfStyleValue::to_string() const { - return String::formatted("{} {}", TRY(m_properties.align_self->to_string()), TRY(m_properties.justify_self->to_string())); + auto align_self = TRY(m_properties.align_self->to_string()); + auto justify_self = TRY(m_properties.justify_self->to_string()); + if (align_self == justify_self) + return String::formatted("{}", align_self); + return String::formatted("{} {}", align_self, justify_self); } }