1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:25:06 +00:00

LibWeb: Update Page to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-08-27 17:06:39 +02:00 committed by Andreas Kling
parent f91b34ef2e
commit ee50d9b2b5
9 changed files with 41 additions and 25 deletions

View file

@ -6,6 +6,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLTitleElement.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Page/Page.h>
namespace Web::HTML {
@ -26,9 +27,8 @@ void HTMLTitleElement::initialize(JS::Realm& realm)
void HTMLTitleElement::children_changed()
{
HTMLElement::children_changed();
if (auto* page = document().page()) {
if (document().browsing_context() == &page->top_level_browsing_context())
page->client().page_did_change_title(document().title());
if (navigable() && navigable()->is_traversable()) {
navigable()->traversable_navigable()->page()->client().page_did_change_title(document().title());
}
}