mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb: Implement last remaining FIXME for wrap editing algorithm
This commit is contained in:
parent
148e465131
commit
9bcf2fc0f5
Notes:
github-actions[bot]
2025-01-10 22:37:57 +00:00
Author: https://github.com/gmta
Commit: 9bcf2fc0f5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
1 changed files with 7 additions and 1 deletions
|
@ -2851,8 +2851,14 @@ GC::Ptr<DOM::Node> wrap(
|
|||
auto first_member = node_list.first();
|
||||
first_member->parent()->insert_before(*new_parent, first_member);
|
||||
|
||||
// FIXME: 2. If any range has a boundary point with node equal to the parent of new parent and offset equal to the
|
||||
// 2. If any range has a boundary point with node equal to the parent of new parent and offset equal to the
|
||||
// index of new parent, add one to that boundary point's offset.
|
||||
auto new_parent_index = new_parent->index();
|
||||
auto active_range = new_parent->document().get_selection()->range();
|
||||
if (active_range && active_range->start_container() == new_parent && active_range->start_offset() == new_parent_index)
|
||||
MUST(active_range->set_start(active_range->start_container(), new_parent_index + 1));
|
||||
if (active_range && active_range->end_container() == new_parent && active_range->end_offset() == new_parent_index)
|
||||
MUST(active_range->set_end(active_range->end_container(), new_parent_index + 1));
|
||||
}
|
||||
|
||||
// 11. Let original parent be the parent of the first member of node list.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue