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

LibWeb: Check paintable of target against null in mousewheel handling

This commit is contained in:
Andi Gallo 2023-08-09 22:36:46 +00:00 committed by Andreas Kling
parent ae7a0c43a9
commit 670bbf24e5

View file

@ -163,6 +163,7 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, unsigned button, un
if (auto result = target_for_mouse_position(position); result.has_value())
paintable = result->paintable;
if (paintable) {
auto* containing_block = paintable->containing_block();
while (containing_block) {
if (containing_block->is_user_scrollable()) {
@ -172,7 +173,6 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, unsigned button, un
containing_block = containing_block->containing_block();
}
if (paintable) {
paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y);
auto node = dom_node_for_event_dispatch(*paintable);