From 01ca7e0544da7b1b0280c5f9b55f5bf809db7d37 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 13 Apr 2023 13:37:19 +0200 Subject: [PATCH] LibWeb: Whine instead of dying on unexpected box during line layout Log a FIXME on the debug log, along with a layout tree dump of the box that we didn't expect to see. This will be annoying (until fixed), but far less so than crashing the browser. --- .../Libraries/LibWeb/Layout/InlineFormattingContext.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp index 71db7cce02..0e379bbbc5 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp @@ -123,7 +123,11 @@ void InlineFormattingContext::dimension_box_on_line(Box const& box, LayoutMode l } // Any box that has simple flow inside should have generated line box fragments already. - VERIFY(!box.display().is_flow_inside()); + if (box.display().is_flow_inside()) { + dbgln("FIXME: InlineFormattingContext::dimension_box_on_line got unexpected box in inline context:"); + dump_tree(box); + return; + } auto const& width_value = box.computed_values().width(); CSSPixels unconstrained_width = 0;