diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index ccbaeb88122..6c0bd2d4686 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -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) diff --git a/Tests/LibWeb/Text/expected/wheel-event-should-be-consumed-by-innermost-scrollable.txt b/Tests/LibWeb/Text/expected/wheel-event-should-be-consumed-by-innermost-scrollable.txt new file mode 100644 index 00000000000..1b47d5e9c43 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wheel-event-should-be-consumed-by-innermost-scrollable.txt @@ -0,0 +1 @@ +inner.scrollTop: 100, inner.scrollLeft: 0 diff --git a/Tests/LibWeb/Text/input/wheel-event-should-be-consumed-by-innermost-scrollable.html b/Tests/LibWeb/Text/input/wheel-event-should-be-consumed-by-innermost-scrollable.html new file mode 100644 index 00000000000..49cf69c0f8d --- /dev/null +++ b/Tests/LibWeb/Text/input/wheel-event-should-be-consumed-by-innermost-scrollable.html @@ -0,0 +1,70 @@ + + + +