1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibWeb: Use struct to pass Navigable::navigate() params

Using structs makes the navigate() calls looks cleaner. No change
in behavior is intended.
This commit is contained in:
Aliaksandr Kalenik 2023-10-10 16:05:38 +02:00 committed by Alexander Kalenik
parent 3e86f88d6a
commit 44f7d7406c
12 changed files with 56 additions and 34 deletions

View file

@ -45,12 +45,14 @@ void Page::set_focused_browsing_context(Badge<EventHandler>, HTML::BrowsingConte
void Page::load(const AK::URL& url)
{
(void)top_level_traversable()->navigate(url, *top_level_traversable()->active_document());
(void)top_level_traversable()->navigate({ .url = url, .source_document = *top_level_traversable()->active_document() });
}
void Page::load_html(StringView html)
{
(void)top_level_traversable()->navigate("about:srcdoc"sv, *top_level_traversable()->active_document(), String::from_utf8(html).release_value_but_fixme_should_propagate_errors());
(void)top_level_traversable()->navigate({ .url = "about:srcdoc"sv,
.source_document = *top_level_traversable()->active_document(),
.document_resource = String::from_utf8(html).release_value_but_fixme_should_propagate_errors() });
}
Gfx::Palette Page::palette() const