1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 15:02:06 +00:00

LibHTML: Simplify Node::create_layout_node()

There's no need to pass the StyleResolver to this function. Nodes that
need it can just get it from the document.
This commit is contained in:
Andreas Kling 2019-10-15 15:06:16 +02:00
parent f7cd5662ef
commit f4f5ede10a
13 changed files with 20 additions and 30 deletions

View file

@ -16,6 +16,7 @@
Document::Document()
: ParentNode(*this, NodeType::DOCUMENT_NODE)
, m_style_resolver(make<StyleResolver>(*this))
{
}
@ -23,13 +24,6 @@ Document::~Document()
{
}
StyleResolver& Document::style_resolver()
{
if (!m_style_resolver)
m_style_resolver = make<StyleResolver>(*this);
return *m_style_resolver;
}
bool Document::is_child_allowed(const Node& node) const
{
switch (node.type()) {
@ -174,7 +168,7 @@ void Document::update_layout()
on_layout_updated();
}
RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const
RefPtr<LayoutNode> Document::create_layout_node(const StyleProperties*) const
{
return adopt(*new LayoutDocument(*this, StyleProperties::create()));
}