mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Add internals.wheel() to simulate mouse wheel events
This function allows us to write tests for scrolling scenarios where the events are processed by the EventHandler.
This commit is contained in:
parent
e38ccebfc8
commit
40246adfb9
5 changed files with 48 additions and 0 deletions
|
@ -83,6 +83,12 @@ void Internals::click(double x, double y)
|
|||
page.handle_mouseup({ x, y }, { x, y }, 1, 0, 0);
|
||||
}
|
||||
|
||||
void Internals::wheel(double x, double y, double delta_x, double delta_y)
|
||||
{
|
||||
auto& page = global_object().browsing_context()->page();
|
||||
page.handle_mousewheel({ x, y }, { x, y }, 0, 0, 0, delta_x, delta_y);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<bool> Internals::dispatch_user_activated_event(DOM::EventTarget& target, DOM::Event& event)
|
||||
{
|
||||
event.set_is_trusted(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue