LibHTML: Use is_inline() instead of !is_block() when building tree

This commit is contained in:
Andreas Kling 2019-10-17 22:42:51 +02:00
commit 14f380f87a
Notes: sideshowbarker 2024-07-19 11:39:36 +09:00

View file

@ -32,14 +32,16 @@ static RefPtr<LayoutNode> 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<LayoutText>(layout_child) && to<LayoutText>(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;
}