diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index b4ea5044fa..a9d420ba25 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -87,7 +87,7 @@ inset-block-end: auto inset-block-start: auto inset-inline-end: auto inset-inline-start: auto -justify-content: flex-start +justify-content: normal justify-items: legacy justify-self: auto left: auto diff --git a/Userland/Libraries/LibWeb/CSS/Enums.json b/Userland/Libraries/LibWeb/CSS/Enums.json index 6afb33b19a..cfe9b8d83b 100644 --- a/Userland/Libraries/LibWeb/CSS/Enums.json +++ b/Userland/Libraries/LibWeb/CSS/Enums.json @@ -206,6 +206,7 @@ "optimizequality=smooth" ], "justify-content": [ + "normal", "start", "end", "flex-start", @@ -213,7 +214,8 @@ "center", "space-between", "space-around", - "space-evenly" + "space-evenly", + "stretch" ], "justify-items": [ "baseline", diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json index 7015c5e09f..ebdef6fa0a 100644 --- a/Userland/Libraries/LibWeb/CSS/Properties.json +++ b/Userland/Libraries/LibWeb/CSS/Properties.json @@ -1264,7 +1264,7 @@ }, "justify-content": { "inherited": false, - "initial": "flex-start", + "initial": "normal", "valid-types": [ "justify-content" ] diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index 2c0aebe9c6..f1ada492f8 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1319,6 +1319,8 @@ void FlexFormattingContext::distribute_any_remaining_free_space() if (auto_margins == 0 && number_of_items > 0) { switch (flex_container().computed_values().justify_content()) { case CSS::JustifyContent::Start: + case CSS::JustifyContent::Stretch: + case CSS::JustifyContent::Normal: initial_offset = 0; break; case CSS::JustifyContent::FlexStart: @@ -1385,11 +1387,13 @@ void FlexFormattingContext::distribute_any_remaining_free_space() if (auto_margins == 0) { switch (flex_container().computed_values().justify_content()) { + case CSS::JustifyContent::Normal: case CSS::JustifyContent::FlexStart: case CSS::JustifyContent::Center: case CSS::JustifyContent::SpaceAround: case CSS::JustifyContent::SpaceBetween: case CSS::JustifyContent::SpaceEvenly: + case CSS::JustifyContent::Stretch: if (is_direction_reverse()) { flex_region_render_cursor = FlexRegionRenderCursor::Right; } @@ -2221,6 +2225,8 @@ CSSPixelPoint FlexFormattingContext::calculate_static_position(Box const& box) c CSSPixels main_offset = 0; switch (flex_container().computed_values().justify_content()) { case CSS::JustifyContent::Start: + case CSS::JustifyContent::Stretch: + case CSS::JustifyContent::Normal: pack_from_end = false; break; case CSS::JustifyContent::FlexStart: