From c7d592dd011797eaed5f23b9dc9c511c7bb3863e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 6 Oct 2022 20:34:55 +0200 Subject: [PATCH] LibWeb: Generate a BlockContainer box for display:inline-flex We were previously generating an InlineNode, which is not a Box. We need some type of Box to do flex layout, so let's just make a BlockContainer. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 3d3f90b91b..000e750013 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -308,7 +308,8 @@ RefPtr Element::create_layout_node_for_display_type(DOM::Document& return adopt_ref(*new Layout::BlockContainer(document, element, move(style))); if (display.is_flow_inside()) return adopt_ref(*new Layout::InlineNode(document, element, move(style))); - + if (display.is_flex_inside()) + return adopt_ref(*new Layout::BlockContainer(document, element, move(style))); dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", display.to_string()); return adopt_ref(*new Layout::InlineNode(document, element, move(style))); }