mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibHTML: Add a simple TreeNode<T> template for making trees.
We'll be making a lot of trees here, so let's share code during bootstrap. Eventually some of these classes are gonna want custom trees but for now we can just fit them all into the same clothes.
This commit is contained in:
@@ -1,11 +1,2 @@
|
||||
#include <LibHTML/DOM/ParentNode.h>
|
||||
|
||||
void ParentNode::append_child(NonnullRefPtr<Node> node)
|
||||
{
|
||||
if (m_last_child)
|
||||
m_last_child->set_next_sibling(node.ptr());
|
||||
node->set_parent_node({}, this);
|
||||
m_last_child = &node.leak_ref();
|
||||
if (!m_first_child)
|
||||
m_first_child = m_last_child;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user