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

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

This exposed a whole slew of now-unnecessary null checks. :^)

Co-Authored-By: Andreas Kling <kling@serenityos.org>
This commit is contained in:
Shannon Booth 2023-12-03 20:29:37 +13:00 committed by Andreas Kling
parent af2bcc3b56
commit 88f8ea7c60
9 changed files with 56 additions and 88 deletions

View file

@ -193,8 +193,7 @@ void Navigable::activate_history_entry(JS::GCPtr<SessionHistoryEntry> entry)
// Not in the spec:
VERIFY(active_browsing_context());
VERIFY(active_browsing_context()->page());
active_browsing_context()->page()->client().page_did_create_new_document(*new_document);
active_browsing_context()->page().client().page_did_create_new_document(*new_document);
}
// https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document
@ -1331,8 +1330,7 @@ WebIDL::ExceptionOr<void> Navigable::navigate(NavigateParams params)
}
if (is_top_level_traversable()) {
if (auto* page = active_browsing_context()->page())
page->client().page_did_start_loading(url, false);
active_browsing_context()->page().client().page_did_start_loading(url, false);
}
// 20. In parallel, run these steps: