From a0f3e2c9a2b82117aa7c1a3444ad0d31baa070d5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 29 Sep 2022 13:22:52 +0200 Subject: [PATCH] LibWeb: Never claim that flex containers create a BFC If a flex item is itself a flex container, we were previously lying when asked if the item created a BFC. It creates an FFC, so stop lying about this in FormattingContext::creates_block_formatting_context(). --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 51e9ca1e89..1d255d5e71 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -65,6 +65,8 @@ bool FormattingContext::creates_block_formatting_context(Box const& box) return true; if (is(box)) return true; + if (box.computed_values().display().is_flex_inside()) + return false; CSS::Overflow overflow_x = box.computed_values().overflow_x(); if ((overflow_x != CSS::Overflow::Visible) && (overflow_x != CSS::Overflow::Clip))