summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.cpp5
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
index 50785f8235..074a0de278 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
@@ -532,7 +532,7 @@ void BrowsingContext::set_active_document(JS::NonnullGCPtr<DOM::Document> docume
// AD-HOC:
document->set_browsing_context(this);
- if (m_page && this == &m_page->top_level_browsing_context())
+ if (m_page && m_page->top_level_browsing_context_is_initialized() && this == &m_page->top_level_browsing_context())
m_page->client().page_did_change_title(document->title());
if (previously_active_document && previously_active_document != document.ptr())
diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp
index 9b1a332f10..b30f3c62f9 100644
--- a/Userland/Libraries/LibWeb/Page/Page.cpp
+++ b/Userland/Libraries/LibWeb/Page/Page.cpp
@@ -158,6 +158,11 @@ bool Page::handle_keyup(KeyCode key, unsigned modifiers, u32 code_point)
return focused_context().event_handler().handle_keyup(key, modifiers, code_point);
}
+bool Page::top_level_browsing_context_is_initialized() const
+{
+ return m_top_level_browsing_context;
+}
+
HTML::BrowsingContext& Page::top_level_browsing_context()
{
return *m_top_level_browsing_context;
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index 3bc9c474ba..fa8368cfd4 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -44,6 +44,9 @@ public:
PageClient& client() { return m_client; }
PageClient const& client() const { return m_client; }
+ // FIXME: This is a hack.
+ bool top_level_browsing_context_is_initialized() const;
+
HTML::BrowsingContext& top_level_browsing_context();
HTML::BrowsingContext const& top_level_browsing_context() const;