summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-03-20 15:20:11 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-21 09:36:37 +0100
commitc183ebc72319b76ea97967dbd9fff9f702e15452 (patch)
treef697e3e8e4c7d7af76d280a91f5d37f4f15a873e /Userland/Libraries/LibWeb/HTML
parentae95ed5ddd5e7ab2b9cc32d78a0761747f229b5f (diff)
downloadserenity-c183ebc72319b76ea97967dbd9fff9f702e15452.zip
LibWeb: Only call page_did_change_title() from main frame
Otherwise an embedded iframe will override the page title in the browser, for example.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
index 426721c124..d0783d404e 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
@@ -42,8 +42,10 @@ HTMLTitleElement::~HTMLTitleElement()
void HTMLTitleElement::children_changed()
{
HTMLElement::children_changed();
- if (auto* page = document().page())
- page->client().page_did_change_title(document().title());
+ if (auto* page = document().page()) {
+ if (document().frame() == &page->main_frame())
+ page->client().page_did_change_title(document().title());
+ }
}
}