Bug 191218

Summary: Touch event not firing while scrolling is in motion
Product: WebKit Reporter: nick <starshiping>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: fred.wang, simon.fraser, thorton, wenson_hsieh
Priority: P2    
Version: Safari 12   
Hardware: iPhone / iPad   
OS: iOS 12   
See Also: https://bugs.webkit.org/show_bug.cgi?id=251513
Attachments:
Description Flags
testcase none

nick
Reported 2018-11-02 16:45:20 PDT
When user scrolls and in the deceleration phase of the inertial scrolling, user touch the screen will make the scrolling stop but no "touch" event is fired. I'd like to detect where the user touch to stop the scrolling but I can't because there's no event firing. Safari and Chrome on iphone have this issue while Android doesn't. I've created a CodePen for testing. https://codepen.io/anon/pen/MzWKrM Please help to fix this.
Attachments
testcase (1.31 KB, text/html)
2019-11-25 09:35 PST, Frédéric Wang (:fredw)
no flags
Frédéric Wang (:fredw)
Comment 1 2019-11-25 09:35:49 PST
Created attachment 384303 [details] testcase Reproducible in iOS 13.3 17C5046a
Frédéric Wang (:fredw)
Comment 2 2019-11-26 08:51:09 PST
Preliminary debugging on the simulator (public SDK): - When you scroll and tap the blue rectangle during scrolling, WKScrollingNodeScrollViewDelegate::scrollViewDidEndDragging is called and just informs ScrollingTreeScrollingNodeDelegateIOS about the scroll & scroll end. - When you tap directly the blue rectangle, WKContentView::_singleTapGestureRecognizer will invoke WebPageProxy::commitPotentialTap in order to tell the Web process to dispatch an event. - WKContentViewInteraction::gestureRecognizerShouldBegin has some logic when tap interrupts a scroll deceleration, but the code does not seem to be called for me. I wonder if there is something wrong in the fact that touch gesture are not handled by WKContentView during scrolling or if the scrolling delegate should do similar work as WKContentView to recognize touch gestures.
Frédéric Wang (:fredw)
Comment 3 2019-12-11 08:32:13 PST
(In reply to Frédéric Wang (:fredw) from comment #2) > - When you scroll and tap the blue rectangle during scrolling, > WKScrollingNodeScrollViewDelegate::scrollViewDidEndDragging is called and > just informs ScrollingTreeScrollingNodeDelegateIOS about the scroll & scroll > end. I tried sending the commitPotentialTap message from there but it does not work. The target node & position must be set first with a potentialTapAtPosition, so it seems the solution will be a bit more complex. > - When you tap directly the blue rectangle, > WKContentView::_singleTapGestureRecognizer will invoke > WebPageProxy::commitPotentialTap in order to tell the Web process to > dispatch an event. WKContentView::_singleTapGestureRecognizer is a WKSyntheticTapGestureRecognizer. However, this listener is not triggered when the UIScrollView is scrolling... > I wonder if there is something wrong in the fact that touch gesture are not > handled by WKContentView during scrolling or if the scrolling delegate > should do similar work as WKContentView to recognize touch gestures. If the former, I guess that's something Apple should fix. For the latter, a proper solution will probably be to use some UITapGestureRecognizer on UIScrollView, if that's ever possible. I'll investigate more on this but found https://stackoverflow.com/questions/27715448/uitapgesturerecognizer-on-uiscrollview
Note You need to log in before you can comment on or make changes to this bug.