summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-08 11:52:39 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-08 11:54:13 +0200
commit26544f559c1bb064e8a090b2bf885205611717b3 (patch)
tree273b2a8a30752f434bec806d359cf8ff29c32043 /Userland/Libraries
parent0b0c4fc1e8506ad046f30f75e281e323ec87151a (diff)
downloadserenity-26544f559c1bb064e8a090b2bf885205611717b3.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.cpp1
1 files changed, 1 insertions, 0 deletions
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> NodeWithStyle::create_anonymous_wrapper() const
{
auto wrapper = adopt_ref(*new BlockContainer(const_cast<DOM::Document&>(document()), nullptr, m_computed_values.clone_inherited_values()));
+ static_cast<CSS::MutableComputedValues&>(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;