From 26544f559c1bb064e8a090b2bf885205611717b3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 8 Sep 2022 11:52:39 +0200 Subject: [PATCH] LibWeb: Make anonymous wrapper blocks actually have "display: block" We didn't set their display at all before, and since CSS display is not inherited, anonymous block wrappers were actually "display: inline", but it kinda worked anyway because we positioned blocks based on their C++ class (BlockContainer) rather than their CSS display value. Now that we position based on CSS display value, this broke positioning of anonymous wrapper blocks, and this fixes that. --- Userland/Libraries/LibWeb/Layout/Node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index e71030e114..e566b683a6 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -585,6 +585,7 @@ bool Node::is_inline_block() const NonnullRefPtr NodeWithStyle::create_anonymous_wrapper() const { auto wrapper = adopt_ref(*new BlockContainer(const_cast(document()), nullptr, m_computed_values.clone_inherited_values())); + static_cast(wrapper->m_computed_values).set_display(CSS::Display(CSS::Display::Outside::Block, CSS::Display::Inside::Flow)); wrapper->m_font = m_font; wrapper->m_line_height = m_line_height; return wrapper;