ParentNode.cpp 302 B

1234567891011
  1. #include <LibHTML/DOM/ParentNode.h>
  2. void ParentNode::append_child(Retained<Node> node)
  3. {
  4. if (m_last_child)
  5. m_last_child->set_next_sibling(node.ptr());
  6. node->set_parent_node({}, this);
  7. m_last_child = &node.leak_ref();
  8. if (!m_first_child)
  9. m_first_child = m_last_child;
  10. }