From d17f94e7cc0259a9726b455199b04688dff742f2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 13 Sep 2024 22:41:01 +0200 Subject: [PATCH] LibWeb: Don't create dummy formating context for internal table boxes Internal table boxes are managed by TFC and do not need a dummy FC. We still need to keep dummy FC for though. --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 4a0db7e5fed..8c7e593e0aa 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -142,14 +142,17 @@ Optional FormattingContext::formatting_context_type_cre if (box.children_are_inline()) return {}; + if (display.is_table_column() || display.is_table_row_group() || display.is_table_header_group() || display.is_table_footer_group() || display.is_table_row() || display.is_table_column_group()) + return {}; + // The box is a block container that doesn't create its own BFC. // It will be formatted by the containing BFC. if (!display.is_flow_inside()) { // HACK: Instead of crashing, create a dummy formatting context that does nothing. - // FIXME: Remove this once it's no longer needed. It currently swallows problem with standalone - // table-related boxes that don't get fixed up by CSS anonymous table box generation. + // FIXME: We need this for elements return Type::InternalDummy; } + return {}; }