1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 10:45:08 +00:00

LibHTML: Make sure every DOM Node belongs to a Document

This commit is contained in:
Andreas Kling 2019-09-29 11:43:07 +02:00
parent 13860e4dd8
commit 1b8509a0c9
9 changed files with 28 additions and 22 deletions

View file

@ -5,7 +5,7 @@
#include <stdio.h>
Document::Document()
: ParentNode(NodeType::DOCUMENT_NODE)
: ParentNode(*this, NodeType::DOCUMENT_NODE)
{
}
@ -28,8 +28,8 @@ void Document::normalize()
return;
}
NonnullRefPtr<Element> body = adopt(*new Element("body"));
NonnullRefPtr<Element> html = adopt(*new Element("html"));
NonnullRefPtr<Element> body = adopt(*new Element(*this, "body"));
NonnullRefPtr<Element> html = adopt(*new Element(*this, "html"));
html->append_child(body);
this->donate_all_children_to(body);
this->append_child(html);