[webkit-changes] [WebKit/WebKit] f9672d: [iOS] Pan gestures immediately after tap do not sc...

Wenson Hsieh noreply at github.com
Tue Apr 11 18:58:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f9672dbf09d92cbcc1ce47ee959a7ff55ed27f9e
      https://github.com/WebKit/WebKit/commit/f9672dbf09d92cbcc1ce47ee959a7ff55ed27f9e
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

  Changed paths:
    A LayoutTests/fast/events/touch/ios/swipe-after-tap-scrolls-web-view-in-non-responsive-viewport-expected.txt
    A LayoutTests/fast/events/touch/ios/swipe-after-tap-scrolls-web-view-in-non-responsive-viewport.html
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [iOS] Pan gestures immediately after tap do not scroll a page with an unresponsive viewport
https://bugs.webkit.org/show_bug.cgi?id=255300
rdar://106010038

Reviewed by Megan Gardner.

Currently, in a page with an unresponsive viewport, attempting to scroll the web view with a pan
gesture immediately after performing a tap does not actually result in any scrolling, since the
scroll view's pan gesture recognizer does not begin. This happens because while the pan gesture is
immediately reset to `Possible` state after the tap, it then transitions to `Failed` state right
away when subsequently panning the web view, since it's excluded by the synthetic tap (single click)
gesture which is still in `Ended` state because it hasn't been reset yet (due to the double click
gesture still being `Possible`).

To avoid this, we allow both the synthetic tap gesture to recognize simultaneously alongside pan
gestures by adding logic to `-gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:`.
This means that instead of transitioning to `Failed` state right away when panning the web view, we
instead remain in `Possible` state, which then allows us to recognize the gesture if the user begins
to actually pan the view.

Test: fast/events/touch/ios/swipe-after-tap-scrolls-web-view-in-non-responsive-viewport.html

* LayoutTests/fast/events/touch/ios/swipe-after-tap-scrolls-web-view-in-non-responsive-viewport-expected.txt: Added.
* LayoutTests/fast/events/touch/ios/swipe-after-tap-scrolls-web-view-in-non-responsive-viewport.html: Added.

Add a layout test to exercise the fix. This test preemptively tries to mitigate any potential
flakiness as a result of either the tap or swipe gesture not getting recognized by automatically
retrying itself several times, until it's successful.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):

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




More information about the webkit-changes mailing list