2019-06-15 18:41:15 -03:00
|
|
|
#include <LibHTML/DOM/ParentNode.h>
|
2019-06-15 13:55:47 -03:00
|
|
|
|
|
|
|
|
void ParentNode::append_child(Retained<Node> node)
|
|
|
|
|
{
|
|
|
|
|
if (m_last_child)
|
|
|
|
|
m_last_child->set_next_sibling(node.ptr());
|
2019-06-15 17:49:44 -03:00
|
|
|
node->set_parent_node({}, this);
|
2019-06-15 13:55:47 -03:00
|
|
|
m_last_child = &node.leak_ref();
|
|
|
|
|
if (!m_first_child)
|
|
|
|
|
m_first_child = m_last_child;
|
|
|
|
|
}
|