1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibWeb: Add initial implementation of document.implementation

This commit is contained in:
Luke 2020-11-13 06:08:06 +00:00 committed by Andreas Kling
parent 3ec54448f5
commit dcb21b0c3a
9 changed files with 191 additions and 6 deletions

View file

@ -68,6 +68,7 @@ Document::Document(const URL& url)
, m_style_sheets(CSS::StyleSheetList::create(*this))
, m_url(url)
, m_window(Window::create_with_document(*this))
, m_implementation(DOMImplementation::create(*this))
{
m_style_update_timer = Core::Timer::create_single_shot(0, [this] {
update_style();
@ -136,6 +137,13 @@ Origin Document::origin() const
return { m_url.protocol(), m_url.host(), m_url.port() };
}
void Document::set_origin(const Origin& origin)
{
m_url.set_protocol(origin.protocol());
m_url.set_host(origin.host());
m_url.set_port(origin.port());
}
void Document::schedule_style_update()
{
if (m_style_update_timer->is_active())