Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 86f6cfcadb5dc2b02991c05da87b2e1d8b4bcf98
      
https://github.com/WebKit/WebKit/commit/86f6cfcadb5dc2b02991c05da87b2e1d8b4bcf98
  Author: Simon Fraser <simon.fra...@apple.com>
  Date:   2023-05-11 (Thu, 11 May 2023)

  Changed paths:
    A 
LayoutTests/swipe/swipe-back-with-active-wheel-listener-and-scroller-expected.txt
    A LayoutTests/swipe/swipe-back-with-active-wheel-listener-and-scroller.html
    A 
LayoutTests/swipe/swipe-back-with-passive-wheel-listener-and-scroller-expected.txt
    A LayoutTests/swipe/swipe-back-with-passive-wheel-listener-and-scroller.html
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  -----------
  [UI-side compositing ]Scrolling carousel on shopping.google.com triggers 
history swipe
https://bugs.webkit.org/show_bug.cgi?id=256508
rdar://108418750

Reviewed by Tim Horton.

shopping.google.com has horizontal scrolling carousels with passive wheel event 
listeners, but with
UI-side compositing enabled, we'd fail to detect that we'd handled scrolls for 
these, which allowed
history swipes to start.

The basic issue is that with passive listeners, the scrolling coordinator gets 
first crack at the
event in `WebPageProxy::handleWheelEvent()`, and may handle it, but the event 
still goes to the web
process for JS dispatch. But when we get back to 
`WebPageProxy::handleWheelEventReply()`, `handled`
is false because it only represents the WebProcess part of handling. Fix that 
by tracking whether
the scrolling tree handled the event first in wasHandledForScrolling, which is 
passed to
`WebPageProxy::sendWheelEvent()` and thence to the reply function.

In addition, we need to know if the post-WebProcess scrolling coordinator 
handling, in
`WebPageProxy::handleWheelEventReply()`, handled the event. To do that we have
`RemoteScrollingTreeMac::handleWheelEventAfterDefaultHandling()` return a 
handled value, which is
bounced back to `WebPageProxy::wheelEventHandlingCompleted()` on the main 
thread.

Since we now pass `handled` to the `WebPage::handleWheelEvent()` completion 
handler, it makes sense
to address the FIXME and remove the separate `WebPageProxy::DidReceiveEvent` 
reply here. This means
that only the non-UI-side compositing WebPageProxy::didReceiveEvent() will run 
for wheel events, so
add an assertion there.

* 
LayoutTests/swipe/swipe-back-with-active-wheel-listener-and-scroller-expected.txt:
 Added.
* LayoutTests/swipe/swipe-back-with-active-wheel-listener-and-scroller.html: 
Added.
* 
LayoutTests/swipe/swipe-back-with-passive-wheel-listener-and-scroller-expected.txt:
 Added.
* LayoutTests/swipe/swipe-back-with-passive-wheel-listener-and-scroller.html: 
Added.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
(WebKit::RemoteScrollingTree::handleWheelEventAfterDefaultHandling):
(WebKit::RemoteScrollingTree::wheelEventDefaultHandlingCompleted): Deleted.
* 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:
(WebKit::RemoteLayerTreeEventDispatcher::internalHandleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::wheelEventHandlingCompleted):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h:
(WebKit::RemoteLayerTreeEventDispatcher::scrollingCoordinator const):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm:
(WebKit::RemoteScrollingTreeMac::handleWheelEventAfterDefaultHandling):
(WebKit::RemoteScrollingTreeMac::wheelEventDefaultHandlingCompleted): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueWheelEventHandling):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleWheelEventReply):
(WebKit::WebPageProxy::didReceiveEvent):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::scrollWheel):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleWheelEvent):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

Canonical link: https://commits.webkit.org/263995@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to