Use the LibWebView history mirror to preserve traversable session history across WebContent process swaps. WebContent reports snapshots to the UI process, and new renderers can be seeded from the mirror. Browser back and forward now resolve through the UI-owned used history steps. WebContent still runs the spec traversal path when the current renderer has enough matching state to do so. Handle canceled and no-op UI navigations without leaving speculative history entries or pending WebDriver waits behind. Preserve traversal precheck state across synchronous IPC shutdown, and avoid overwriting a restored target entry's persisted scroll state before the document has adopted that entry.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2022-2024, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <WebDriver/Client.h>
|
|
#include <WebDriver/WebContentConnection.h>
|
|
|
|
namespace WebDriver {
|
|
|
|
WebContentConnection::WebContentConnection(NonnullOwnPtr<IPC::Transport> transport)
|
|
: IPC::ConnectionFromClient<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(transport), 1)
|
|
{
|
|
}
|
|
|
|
void WebContentConnection::die()
|
|
{
|
|
if (on_close)
|
|
on_close();
|
|
}
|
|
|
|
void WebContentConnection::driver_execution_complete(Web::WebDriver::Response response)
|
|
{
|
|
if (on_driver_execution_complete)
|
|
on_driver_execution_complete(move(response));
|
|
}
|
|
|
|
void WebContentConnection::did_set_window_handle(String handle)
|
|
{
|
|
if (on_did_set_window_handle)
|
|
on_did_set_window_handle(move(handle));
|
|
}
|
|
|
|
void WebContentConnection::did_start_window_replacement(String handle)
|
|
{
|
|
if (on_did_start_window_replacement)
|
|
on_did_start_window_replacement(move(handle));
|
|
}
|
|
|
|
void WebContentConnection::did_close_window(String handle)
|
|
{
|
|
if (on_did_close_window)
|
|
on_did_close_window(move(handle));
|
|
}
|
|
|
|
}
|