summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-07 16:11:09 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-07 17:10:12 +0200
commit5975a425bd224172a823e4f7e16d09f4b805d901 (patch)
tree07dc50f5cdf9d6e6b2551dffa45cd682c5cc57a8 /Libraries
parent7527b9ee72075accc40be5acc2af3ddd3fbce250 (diff)
downloadserenity-5975a425bd224172a823e4f7e16d09f4b805d901.zip
LibWeb: Turn floated display:inline elements into block-level elements
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibWeb/DOM/Element.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp
index dfbd322a97..27e00d63d1 100644
--- a/Libraries/LibWeb/DOM/Element.cpp
+++ b/Libraries/LibWeb/DOM/Element.cpp
@@ -121,8 +121,13 @@ RefPtr<LayoutNode> Element::create_layout_node(const StyleProperties* parent_sty
if (display == CSS::Display::Block)
return adopt(*new LayoutBlock(document(), this, move(style)));
- if (display == CSS::Display::Inline)
+
+ if (display == CSS::Display::Inline) {
+ if (style->float_().value_or(CSS::Float::None) != CSS::Float::None)
+ return adopt(*new LayoutBlock(document(), this, move(style)));
return adopt(*new LayoutInline(document(), *this, move(style)));
+ }
+
if (display == CSS::Display::ListItem)
return adopt(*new LayoutListItem(document(), *this, move(style)));
if (display == CSS::Display::Table)