mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
LibWeb: Check paintable of target against null in mousewheel handling
This commit is contained in:
parent
ae7a0c43a9
commit
670bbf24e5
Notes:
sideshowbarker
2024-07-17 08:45:34 +09:00
Author: https://github.com/axgallo Commit: https://github.com/SerenityOS/serenity/commit/670bbf24e5 Pull-request: https://github.com/SerenityOS/serenity/pull/20469
@ -163,16 +163,16 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, unsigned button, un
|
||||
if (auto result = target_for_mouse_position(position); result.has_value())
|
||||
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) {
|
||||
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);
|
||||
|
||||
auto node = dom_node_for_event_dispatch(*paintable);
|
||||
|
Loading…
Reference in New Issue
Block a user