mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58:11 +00:00
LibHTML: Update the removed node's siblings in TreeNode::remove_child()
Oops, we forgot to update the node's siblings' sibling pointers when removing a node from the tree. Thanks to Owlinated for pointing this out! :^)
This commit is contained in:
parent
96c1e36ed3
commit
69883bea6f
1 changed files with 6 additions and 0 deletions
|
@ -121,6 +121,12 @@ inline NonnullRefPtr<T> TreeNode<T>::remove_child(NonnullRefPtr<T> node, bool ca
|
|||
if (m_last_child == node)
|
||||
m_last_child = node->m_previous_sibling;
|
||||
|
||||
if (node->m_next_sibling)
|
||||
node->m_next_sibling->m_previous_sibling = node->m_previous_sibling;
|
||||
|
||||
if (node->m_previous_sibling)
|
||||
node->m_previous_sibling->m_next_sibling = node->m_next_sibling;
|
||||
|
||||
node->m_next_sibling = nullptr;
|
||||
node->m_previous_sibling = nullptr;
|
||||
node->m_parent = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue