haikuwebkit/Source/WebCore/page/mac
Simon Fraser 226390f3bc Vertical scroll with mouse wheel in horizontal scroller fails to propagate to the document
https://bugs.webkit.org/show_bug.cgi?id=228891
<rdar://81640239>

Reviewed by Antti Koivisto.

Source/WebCore:

If a page has a horizontal scrolling carousel with a non-passive wheel event handler, and a
user with a clicky scroll wheel mouse tries to vertically scroll over that carousel, then
we'd fail to propagate the scroll to the page. This affects apple.com/store.

This happened because we don't do latching for legacy mouse wheel events, so we hit the code
in EventHandler::handleWheelEventInAppropriateEnclosingBox(); this finds the carousel and
calls handleWheelEventInScrollableArea(), but that dispatches to the scrolling thread in way
that does not propagate the event to the nearest ancestor that can handle it.

The fix is to check that the ScrollableArea can handle the event, sharing some code that
already exists and was used by findEnclosingScrollableContainer(). This is a conservative
fix; it's possible that scrollableAreaCanHandleEvent() could be called down in
handleWheelEventInScrollableArea() but that will affect other call sites.

Test: fast/scrolling/mac/vertical-scroll-in-horizontal-scroller.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::scrollableAreaCanHandleEvent):
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::findEnclosingScrollableContainer):

LayoutTests:

* fast/scrolling/mac/vertical-scroll-in-horizontal-scroller-expected.txt: Added.
* fast/scrolling/mac/vertical-scroll-in-horizontal-scroller.html: Added.
* tiled-drawing/scrolling/overflow-scroll-reduced-content.html: Convert this test to use
async scrolling. webkit.org/b/228898 tracks an existing problem that caused the test
to fail with non-async scrolling.


Canonical link: https://commits.webkit.org/240377@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-09 23:41:29 +00:00
..
ChromeMac.mm
DragControllerMac.mm Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
EventHandlerMac.mm Vertical scroll with mouse wheel in horizontal scroller fails to propagate to the document 2021-08-09 23:41:29 +00:00
ImageOverlayControllerMac.mm [macOS] Move DataDetectors softlinking in DataDetectorsSPI.h out into a separate PAL header 2021-06-06 01:18:09 +00:00
PageMac.mm
ServicesOverlayController.h [macOS] Pull ServicesOverlayController::Highlight out into a separate helper class 2021-05-19 20:30:27 +00:00
ServicesOverlayController.mm [macOS] Move DataDetectors softlinking in DataDetectorsSPI.h out into a separate PAL header 2021-06-06 01:18:09 +00:00
TextIndicatorWindow.h Add textIndicator bounce for AppHighlights on scroll. 2021-05-13 21:57:45 +00:00
TextIndicatorWindow.mm Add textIndicator bounce for AppHighlights on scroll. 2021-05-13 21:57:45 +00:00
WebCoreFrameView.h
WheelEventDeltaFilterMac.h
WheelEventDeltaFilterMac.mm