1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 00:47:45 +00:00

Browser+Ladybird+LibWebView: Handle trivial content APIs in LibWebView

The goal here is to reduce the amount of WebContent client APIs that are
duplicated across every ViewImplementation. Across our three browsers,
we currently:

    Ladybird - Mix some AK::Function callbacks and Qt signals to notify
    tabs of WebContent events.

    Browser - Use only AK::Function callbacks.

    headless-browser - Drop most events on the floor.

Instead, let's only use AK::Function callbacks across all three browsers
to propagate events to tabs. This allows us to invoke those callbacks
directly from LibWebView instead of all three browsers needing to define
a trivial `if (callback) callback();` override of a LibWebView virtual
function. For headless-browser, we can simply not set these callbacks.

As a first pass, this only converts WebContent events that are trivial
to this approach. That is, events that were simply passed onto the tab
or handled without much fuss.
This commit is contained in:
Timothy Flynn 2023-05-17 12:37:31 -04:00 committed by Andreas Kling
parent c113d780c6
commit 6970f1b6c1
10 changed files with 236 additions and 799 deletions

View file

@ -37,6 +37,9 @@ public:
HistoryNavigation,
};
void navigate(QString, LoadType = LoadType::Normal);
void back();
void forward();
void reload();
void debug_request(DeprecatedString const& request, DeprecatedString const& argument);
@ -54,11 +57,6 @@ public:
public slots:
void focus_location_editor();
void location_edit_return_pressed();
void page_title_changed(QString);
void page_favicon_changed(QIcon);
void back();
void forward();
void reload();
signals:
void title_changed(int id, QString);