1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 13:48:12 +00:00

LibHTML: Refactor to go from DOM -> styled tree -> layout tree.

Frame::layout() drives everything now, it takes the DOM contained in the
frame and puts it through the tree transformations.
This commit is contained in:
Andreas Kling 2019-06-29 21:42:07 +02:00
parent 6e95b11395
commit 7eef69ad4b
20 changed files with 132 additions and 131 deletions

View file

@ -62,18 +62,3 @@ bool Element::has_class(const StringView& class_name) const
}
return false;
}
RefPtr<LayoutNode> Element::create_layout_node()
{
if (m_tag_name == "html")
return adopt(*new LayoutBlock(*this));
if (m_tag_name == "body")
return adopt(*new LayoutBlock(*this));
if (m_tag_name == "h1")
return adopt(*new LayoutBlock(*this));
if (m_tag_name == "p")
return adopt(*new LayoutBlock(*this));
if (m_tag_name == "b")
return adopt(*new LayoutInline(*this));
return nullptr;
}