summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-08 14:48:03 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-08 15:56:00 +0200
commit1ebae7a779a4dfabaeb836b6b44f1b3c5ed896c1 (patch)
tree1cf828655571139c04d1eb4df054b4981ba7f39d /Userland
parent771208d2e284cd8ae99f05a46a7c984a5dc417c6 (diff)
downloadserenity-1ebae7a779a4dfabaeb836b6b44f1b3c5ed896c1.zip
LibWeb: Stop changing width of block-level flex containers during layout
If the parent BFC can come up with a nice stretch-fit width for the flex container, it will have already done so *before* even entering flex layout. There's no need to do it again, midway through the flex layout algorithm. This wasn't just unnecessary, but we were also doing it incorrectly and not taking margins into account when calculating the amount of available space for stretch-fit. This led to oversized flex containers in the presence of negative margins. Fixes #18614
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index 39b5ce67bb..2a92319614 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -1056,9 +1056,10 @@ CSSPixels BlockFormattingContext::greatest_child_width(Box const& box) const
return max_width;
}
-void BlockFormattingContext::determine_width_of_child(Box const& box, AvailableSpace const& available_space)
+void BlockFormattingContext::determine_width_of_child(Box const&, AvailableSpace const&)
{
- compute_width(box, available_space);
+ // NOTE: We don't do anything here, since we'll have already determined the width of the child
+ // before recursing into nested layout within the child.
}
void BlockFormattingContext::determine_height_of_child(Box const& box, AvailableSpace const& available_space)