mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 14:48:15 +00:00
LibWeb: Add a way to construct HTML::Window without a DOM::Document
This will be used to implement the rather intricate construction order in the HTML spec.
This commit is contained in:
@@ -56,11 +56,24 @@ private:
|
||||
u32 m_handle { 0 };
|
||||
};
|
||||
|
||||
NonnullRefPtr<Window> Window::create()
|
||||
{
|
||||
return adopt_ref(*new Window);
|
||||
}
|
||||
|
||||
NonnullRefPtr<Window> Window::create_with_document(DOM::Document& document)
|
||||
{
|
||||
return adopt_ref(*new Window(document));
|
||||
}
|
||||
|
||||
Window::Window()
|
||||
: DOM::EventTarget()
|
||||
, m_performance(make<HighResolutionTime::Performance>(*this))
|
||||
, m_crypto(Crypto::Crypto::create())
|
||||
, m_screen(CSS::Screen::create({}, *this))
|
||||
{
|
||||
}
|
||||
|
||||
Window::Window(DOM::Document& document)
|
||||
: DOM::EventTarget()
|
||||
, m_associated_document(document)
|
||||
@@ -670,4 +683,9 @@ void Window::cancel_idle_callback(u32 handle)
|
||||
});
|
||||
}
|
||||
|
||||
void Window::set_associated_document(DOM::Document& document)
|
||||
{
|
||||
m_associated_document = document;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user