From 3ac9ea369daf81f78737e94ab4b22e2cd0fc928d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 27 Mar 2022 23:37:45 +0200 Subject: [PATCH] LibWeb: Don't choke on ICB with inline children Let's relax our assumption about what kind of children the ICB has. This is preparation for loading XHTML documents. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 412d67b14a..e8072692c2 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -541,8 +541,10 @@ void BlockFormattingContext::layout_initial_containing_block(LayoutMode layout_m auto& icb = verify_cast(root()); auto& icb_state = m_state.get_mutable(icb); - VERIFY(!icb.children_are_inline()); - layout_block_level_children(root(), layout_mode); + if (root().children_are_inline()) + layout_inline_children(root(), layout_mode); + else + layout_block_level_children(root(), layout_mode); // Compute scrollable overflow. float bottom_edge = 0;