mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 10:37:44 +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:
parent
3e86f88d6a
commit
44f7d7406c
12 changed files with 56 additions and 34 deletions
|
@ -285,7 +285,7 @@ bool EventHandler::handle_mouseup(CSSPixelPoint position, CSSPixelPoint screen_p
|
|||
auto url = document->parse_url(href);
|
||||
dbgln("Web::EventHandler: Clicking on a link to {}", url);
|
||||
if (button == GUI::MouseButton::Primary) {
|
||||
MUST(document->navigable()->navigate(url, document));
|
||||
MUST(document->navigable()->navigate({ .url = url, .source_document = document }));
|
||||
} else if (button == GUI::MouseButton::Middle) {
|
||||
if (auto* page = m_browsing_context->page())
|
||||
page->client().page_did_middle_click_link(url, link->target(), modifiers);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue