Bug 173354 - [Mac] Don't use the scrolling tree to handle wheel events when it contains transforms that are not axis-aligned
Summary: [Mac] Don't use the scrolling tree to handle wheel events when it contains tr...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Frédéric Wang (:fredw)
Keywords: InRadar
Depends on: 172917
Blocks: 171667
  Show dependency treegraph
Reported: 2017-06-14 00:59 PDT by Frédéric Wang (:fredw)
Modified: 2019-02-21 11:20 PST (History)
4 users (show)

See Also:

Patch (13.13 KB, patch)
2017-06-14 02:08 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (13.55 KB, patch)
2018-11-22 12:52 PST, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2017-06-14 00:59:49 PDT
Extracted from bug 171667. Handling transforms might be a little bit complicated, so we can start by falling back to the slow path.
Comment 1 Frédéric Wang (:fredw) 2017-06-14 02:08:41 PDT
Created attachment 312871 [details]

(In reply to Frédéric Wang (:fredw) from comment #30)
> Created attachment 311503 [details]
> Patch (do not use async scrolling when there are transformed nodes)
> This is an attempt to avoid async scrolling when there are transformed
> nodes, but it does not work.

I debugged this again and my attempt was actually correct... When there is a transform on the scrolling tree, ScrollingTree::shouldHandleWheelEventSynchronously will return true, tryToHandleWheelEvent will return SendToMainThread and EventDispatcher will thus pass the event to the main thread instead of calling ScrollingTree::handleWheelEvent. However, at the end the the following call stack is executed:

ScrollingTree::handleWheelEvent (scrolling thread)
ThreadedScrollingTree::handleWheelEvent (scrolling thread)
ScrollingCoordinatorMac::handleWheelEvent (main thread)
FrameView::wheelEvent (main thread)
EventHandlerMac's EventHandler::platformCompleteWheelEvent (main thread)
EventHandler::handleWheelEvent (main thread)

so the event is still handled by the scrolling thread!

@Simon: I commented the guilty part out in FrameView::wheelEvent, so that ScrollableArea::handleWheelEvent is called instead and things work as I expected, but I wonder what would be the proper way to fix that?
Comment 2 Frédéric Wang (:fredw) 2018-11-22 12:52:24 PST
Created attachment 355487 [details]

Comment 3 Radar WebKit Bug Importer 2019-01-29 20:44:42 PST
Comment 4 Simon Fraser (smfr) 2019-02-21 11:20:56 PST
We'll need this at some point (I am not working on this currently).