From 895ec6ad0953656dfc4e173f2382f9da54d1b244 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 26 Oct 2023 22:24:55 +0200 Subject: [PATCH] LibWeb: Remove unused append_child and remove_child in BrowsingContext A part of post navigables cleanup. --- .../Libraries/LibWeb/HTML/BrowsingContext.cpp | 34 ------------------- .../Libraries/LibWeb/HTML/BrowsingContext.h | 2 -- 2 files changed, 36 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 79fff389a5..640697520b 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -728,40 +728,6 @@ BrowsingContext const* BrowsingContext::the_one_permitted_sandboxed_navigator() return nullptr; } -void BrowsingContext::append_child(JS::NonnullGCPtr child) -{ - VERIFY(!child->m_parent); - - if (m_last_child) - m_last_child->m_next_sibling = child; - child->m_previous_sibling = m_last_child; - child->m_parent = this; - m_last_child = child; - if (!m_first_child) - m_first_child = m_last_child; -} - -void BrowsingContext::remove_child(JS::NonnullGCPtr child) -{ - VERIFY(child->m_parent.ptr() == this); - - if (m_first_child == child) - m_first_child = child->m_next_sibling; - - if (m_last_child == child) - m_last_child = child->m_previous_sibling; - - if (child->m_next_sibling) - child->m_next_sibling->m_previous_sibling = child->m_previous_sibling; - - if (child->m_previous_sibling) - child->m_previous_sibling->m_next_sibling = child->m_next_sibling; - - child->m_next_sibling = nullptr; - child->m_previous_sibling = nullptr; - child->m_parent = nullptr; -} - JS::GCPtr BrowsingContext::first_child() const { return m_first_child; diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index c0986ee5bd..cf1fc7871e 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -50,8 +50,6 @@ public: JS::NonnullGCPtr top_level_traversable() const; JS::GCPtr parent() const { return m_parent; } - void append_child(JS::NonnullGCPtr); - void remove_child(JS::NonnullGCPtr); JS::GCPtr first_child() const; JS::GCPtr next_sibling() const;