LibHTML: Make Node::create_layout_node() virtual

Instead of branching on the Node type, let subclasses decide how their
layout nodes get constructed.

This will allow elements to create custom layout nodes if they want.
This commit is contained in:
Andreas Kling 2019-10-05 22:27:52 +02:00
commit f150134de9
Notes: sideshowbarker 2024-07-19 11:48:31 +09:00
8 changed files with 36 additions and 27 deletions

View file

@ -125,3 +125,8 @@ URL Document::complete_url(const String& string) const
url.set_path(fspath.string());
return url;
}
RefPtr<LayoutNode> Document::create_layout_node(const StyleResolver&, const StyleProperties*) const
{
return adopt(*new LayoutDocument(*this, StyleProperties::create()));
}