diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-08 11:52:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-08 11:54:13 +0200 |
commit | 26544f559c1bb064e8a090b2bf885205611717b3 (patch) | |
tree | 273b2a8a30752f434bec806d359cf8ff29c32043 /Userland/Libraries | |
parent | 0b0c4fc1e8506ad046f30f75e281e323ec87151a (diff) | |
download | serenity-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.cpp | 1 |
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; |