1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibWeb: Honor gap between flex lines when using align-content: stretch

We have to take the cross gap into account when calculating the "sum of
flex line cross sizes" in "Handle 'align-content: stretch'".
This commit is contained in:
Andreas Kling 2023-04-16 19:31:55 +02:00
parent f488df0e10
commit b9b6037d2b
3 changed files with 30 additions and 0 deletions

View file

@ -2022,6 +2022,9 @@ void FlexFormattingContext::handle_align_content_stretch()
for (auto& line : m_flex_lines)
sum_of_flex_line_cross_sizes += line.cross_size;
// CSS-FLEXBOX-2: Account for gap between flex lines.
sum_of_flex_line_cross_sizes += cross_gap() * (m_flex_lines.size() - 1);
if (sum_of_flex_line_cross_sizes >= inner_cross_size(flex_container()))
return;