LibWeb: Try to dispatch wheel event on hit-testing target first

...before falling back to containing block. Fixes a bug when we can't
scroll innermost scrollable element, because wheel event dispatching
immediately falls back to containing block.
This commit is contained in:
Aliaksandr Kalenik 2025-10-03 17:51:22 +02:00 committed by Jelle Raaijmakers
parent b1a7782c59
commit c5da92f664
Notes: github-actions[bot] 2025-10-03 17:35:33 +00:00
3 changed files with 72 additions and 1 deletions

View file

@ -408,7 +408,7 @@ EventResult EventHandler::handle_mousewheel(CSSPixelPoint viewport_position, CSS
paintable = result->paintable;
if (paintable) {
auto* containing_block = paintable->containing_block();
Painting::Paintable* containing_block = paintable;
while (containing_block) {
auto handled_scroll_event = containing_block->handle_mousewheel({}, viewport_position, buttons, modifiers, wheel_delta_x, wheel_delta_y);
if (handled_scroll_event)