LibWeb: Two more edge cases for TreeNode::insert_before.
This commit is contained in:
parent
210a3db44d
commit
83f6b8bc9a
Notes:
sideshowbarker
2024-07-19 01:14:22 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/83f6b8bc9a4 Pull-request: https://github.com/SerenityOS/serenity/pull/4183
1 changed files with 6 additions and 0 deletions
|
@ -380,6 +380,12 @@ inline void TreeNode<T>::insert_before(NonnullRefPtr<T> node, RefPtr<T> child, b
|
|||
node->m_previous_sibling = child->m_previous_sibling;
|
||||
node->m_next_sibling = child;
|
||||
|
||||
if (child->m_previous_sibling)
|
||||
child->m_previous_sibling->m_next_sibling = node;
|
||||
|
||||
if (m_first_child == child)
|
||||
m_first_child = node;
|
||||
|
||||
child->m_previous_sibling = node;
|
||||
|
||||
if (m_first_child == child)
|
||||
|
|
Loading…
Add table
Reference in a new issue