diff --git a/Tests/LibWeb/Text/expected/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.txt b/Tests/LibWeb/Text/expected/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.txt new file mode 100644 index 00000000000..a6cf81cb72e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.txt @@ -0,0 +1,2 @@ + scrollable.scrollTop: 200 +window.scrollY: 0 diff --git a/Tests/LibWeb/Text/input/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.html b/Tests/LibWeb/Text/input/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.html new file mode 100644 index 00000000000..07ef31afd4a --- /dev/null +++ b/Tests/LibWeb/Text/input/wheel-events-consumed-by-scrollable-should-not-be-propagated-to-body-2.html @@ -0,0 +1,33 @@ + + +
+
+
+ + diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index a79e0535b10..bc337ab4502 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -180,7 +180,8 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, CSSPixelPoint scree containing_block = containing_block->containing_block(); } - paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y); + if (paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y)) + return true; auto node = dom_node_for_event_dispatch(*paintable);