mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Wrap inline children without utilizing a Vector
No functional changes.
This commit is contained in:
parent
6f800caeaa
commit
94ae63c436
Notes:
github-actions[bot]
2025-04-24 17:13:46 +00:00
Author: https://github.com/gmta
Commit: 94ae63c436
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4448
1 changed files with 6 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue