From ee671a20cc23930f84110cb43f4fd0c40ebdf256 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 15 Sep 2021 12:26:12 +0100 Subject: [PATCH] LibWeb: Make flex-box ignore out-of-flow child boxes Previously, out-of-flow children still took up space inside a flex-box container, leaving an odd gap. Now they don't! :^) --- Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index fa756ca6fc..dd4dee20ba 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -238,6 +238,10 @@ void FlexFormattingContext::run(Box& box, LayoutMode) return IterationDecision::Continue; } + // Skip any "out-of-flow" children + if (child_box.is_out_of_flow(*this)) + return IterationDecision::Continue; + child_box.set_flex_item(true); flex_items.append({ child_box }); return IterationDecision::Continue;