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

LibWeb: Make Document::page() return a Page&

Now that Document always has a Page, and always keeps it alive, we can
make this return a Page&, exposing various unnecessary null checks.
This commit is contained in:
Andreas Kling 2023-12-15 15:41:28 +01:00
parent 70193c0009
commit 7c95ebc302
17 changed files with 43 additions and 78 deletions

View file

@ -33,16 +33,14 @@ void SVGTitleElement::children_changed()
{
Base::children_changed();
auto* page = document().page();
if (!page)
return;
if (document().browsing_context() != &page->top_level_browsing_context())
auto& page = document().page();
if (document().browsing_context() != &page.top_level_browsing_context())
return;
auto* document_element = document().document_element();
if (document_element == parent() && is<SVGElement>(document_element))
page->client().page_did_change_title(document().title().to_deprecated_string());
page.client().page_did_change_title(document().title().to_deprecated_string());
}
}