From 14f380f87a361694b17c94c85e4f293ba0d09f75 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 17 Oct 2019 22:42:51 +0200 Subject: [PATCH] LibHTML: Use is_inline() instead of !is_block() when building tree --- Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp b/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp index 1b56bb830c..2a3637b6b3 100644 --- a/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp +++ b/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp @@ -32,14 +32,16 @@ static RefPtr create_layout_tree(Node& node, const StyleProperties* layout_children.append(layout_child.release_nonnull()); }); - for (auto& layout_child : layout_children) - if (have_block_children && have_inline_children && !layout_child.is_block()) { + for (auto& layout_child : layout_children) { + if (have_block_children && have_inline_children && layout_child.is_inline()) { if (is(layout_child) && to(layout_child).text_for_style(*parent_style) == " ") continue; layout_node->inline_wrapper().append_child(layout_child); } else { layout_node->append_child(layout_child); } + } + return layout_node; }