mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Wrap inline children without utilizing a Vector
No functional changes.
This commit is contained in:
parent
6f800caeaa
commit
94ae63c436
|
|
@ -125,15 +125,14 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
|
|||
}
|
||||
|
||||
// Parent block has inline-level children (our siblings); wrap these siblings into an anonymous wrapper block.
|
||||
Vector<GC::Ref<Node>> children;
|
||||
for (GC::Ptr<Node> child = layout_parent.first_child(); child; child = child->next_sibling())
|
||||
children.append(*child);
|
||||
|
||||
auto wrapper = layout_parent.create_anonymous_wrapper();
|
||||
wrapper->set_children_are_inline(true);
|
||||
for (auto child : children) {
|
||||
layout_parent.remove_child(child);
|
||||
wrapper->append_child(child);
|
||||
|
||||
for (GC::Ptr<Node> child = layout_parent.first_child(); child;) {
|
||||
GC::Ptr<Node> next_child = child->next_sibling();
|
||||
layout_parent.remove_child(*child);
|
||||
wrapper->append_child(*child);
|
||||
child = next_child;
|
||||
}
|
||||
|
||||
layout_parent.set_children_are_inline(false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user