1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

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
parent 775cbbb422
commit 14f380f87a

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;
}