mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Fix node insertion in split_the_parent_of_nodes()
If we are to insert nodes _before_ the original parent, we need to insert them at the original parent's index, not the index before that.
This commit is contained in:
parent
83f48a07d4
commit
2987dd1060
Notes:
github-actions[bot]
2025-01-10 22:38:53 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/2987dd1060d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
1 changed files with 1 additions and 1 deletions
|
@ -2512,7 +2512,7 @@ void split_the_parent_of_nodes(Vector<GC::Ref<DOM::Node>> const& node_list)
|
|||
// 8. For each node in node list, insert node into the parent of original parent immediately
|
||||
// before original parent, preserving ranges.
|
||||
for (auto node : node_list)
|
||||
move_node_preserving_ranges(node, parent_of_original_parent, original_parent_index - 1);
|
||||
move_node_preserving_ranges(node, parent_of_original_parent, original_parent_index++);
|
||||
|
||||
// 9. If follows line break is true, and the first member of node list does not follow a line
|
||||
// break, call createElement("br") on the context object and insert the result immediately
|
||||
|
|
Loading…
Add table
Reference in a new issue