mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibHTML: Move Element construction to a separate file
We now have create_element(document, tag_name) in ElementFactory. This will be useful for constructing new elements outside of parsing.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <LibHTML/DOM/Document.h>
|
||||
#include <LibHTML/DOM/DocumentType.h>
|
||||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/DOM/ElementFactory.h>
|
||||
#include <LibHTML/DOM/HTMLBodyElement.h>
|
||||
#include <LibHTML/DOM/HTMLHeadElement.h>
|
||||
#include <LibHTML/DOM/HTMLHtmlElement.h>
|
||||
@@ -36,8 +37,8 @@ void Document::fixup()
|
||||
if (is<HTMLHtmlElement>(first_child()->next_sibling()))
|
||||
return;
|
||||
|
||||
auto body = adopt(*new HTMLBodyElement(*this, "body"));
|
||||
auto html = adopt(*new HTMLHtmlElement(*this, "html"));
|
||||
auto body = create_element(*this, "body");
|
||||
auto html = create_element(*this, "html");
|
||||
html->append_child(body);
|
||||
this->donate_all_children_to(body);
|
||||
this->append_child(html);
|
||||
|
||||
Reference in New Issue
Block a user