diff options
author | Linus Groh <mail@linusgroh.de> | 2021-03-20 15:20:11 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-21 09:36:37 +0100 |
commit | c183ebc72319b76ea97967dbd9fff9f702e15452 (patch) | |
tree | f697e3e8e4c7d7af76d280a91f5d37f4f15a873e /Userland/Libraries/LibWeb/HTML | |
parent | ae95ed5ddd5e7ab2b9cc32d78a0761747f229b5f (diff) | |
download | serenity-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.cpp | 6 |
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()); + } } } |