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
commit 0e881bc5d7
Notes: sideshowbarker 2024-07-18 21:46:36 +09:00
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);