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

LibWeb: Handle scrolling an OutOfProcessWebView

When a mousewheel scroll event isn't handled by the web content
itself (e.g. an overflowed box or similar), the event needs to get
passed back up to the OutOfProcessWebView.
This commit is contained in:
Angus Gibson 2021-03-02 08:39:07 +11:00 committed by Andreas Kling
parent e9c1d9c89a
commit 0e881bc5d7
9 changed files with 24 additions and 0 deletions

View file

@ -245,6 +245,11 @@ void OutOfProcessWebView::notify_server_did_change_title(Badge<WebContentClient>
on_title_change(title);
}
void OutOfProcessWebView::notify_server_did_request_scroll(Badge<WebContentClient>, int wheel_delta)
{
vertical_scrollbar().set_value(vertical_scrollbar().value() + wheel_delta * 20);
}
void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect& rect)
{
scroll_into_view(rect, true, true);