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:
parent
ae7a0c43a9
commit
670bbf24e5
1 changed files with 9 additions and 9 deletions
|
@ -163,16 +163,16 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, unsigned button, un
|
||||||
if (auto result = target_for_mouse_position(position); result.has_value())
|
if (auto result = target_for_mouse_position(position); result.has_value())
|
||||||
paintable = result->paintable;
|
paintable = result->paintable;
|
||||||
|
|
||||||
auto* containing_block = paintable->containing_block();
|
|
||||||
while (containing_block) {
|
|
||||||
if (containing_block->is_user_scrollable()) {
|
|
||||||
const_cast<Painting::PaintableBox*>(containing_block->paintable_box())->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x * scroll_step_size, wheel_delta_y * scroll_step_size);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
containing_block = containing_block->containing_block();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (paintable) {
|
if (paintable) {
|
||||||
|
auto* containing_block = paintable->containing_block();
|
||||||
|
while (containing_block) {
|
||||||
|
if (containing_block->is_user_scrollable()) {
|
||||||
|
const_cast<Painting::PaintableBox*>(containing_block->paintable_box())->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x * scroll_step_size, wheel_delta_y * scroll_step_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
containing_block = containing_block->containing_block();
|
||||||
|
}
|
||||||
|
|
||||||
paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y);
|
paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y);
|
||||||
|
|
||||||
auto node = dom_node_for_event_dispatch(*paintable);
|
auto node = dom_node_for_event_dispatch(*paintable);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue