LibWeb: Move DOM::Document factory functions out of line

This commit is contained in:
Andreas Kling 2022-08-01 22:50:31 +02:00
parent 50d951aea2
commit b838f2029b
2 changed files with 12 additions and 9 deletions

View file

@ -74,6 +74,16 @@
namespace Web::DOM {
NonnullRefPtr<Document> Document::create_with_global_object(Bindings::WindowObject&)
{
return Document::create();
}
NonnullRefPtr<Document> Document::create(AK::URL const& url)
{
return adopt_ref(*new Document(url));
}
Document::Document(const AK::URL& url)
: ParentNode(*this, NodeType::DOCUMENT_NODE)
, m_style_computer(make<CSS::StyleComputer>(*this))

View file

@ -51,15 +51,8 @@ public:
HTML
};
static NonnullRefPtr<Document> create(const AK::URL& url = "about:blank"sv)
{
return adopt_ref(*new Document(url));
}
static NonnullRefPtr<Document> create_with_global_object(Bindings::WindowObject&)
{
return Document::create();
}
static NonnullRefPtr<Document> create(AK::URL const& url = "about:blank"sv);
static NonnullRefPtr<Document> create_with_global_object(Bindings::WindowObject&);
virtual ~Document() override;
size_t next_layout_node_serial_id(Badge<Layout::Node>) { return m_next_layout_node_serial_id++; }