Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REGRESSION: sreality.cz: pinch zooming on maps causes tab to enter Tab Overview instead of interacting with map #9901

Merged
merged 1 commit into from Feb 15, 2023

Conversation

rr-codes
Copy link
Contributor

@rr-codes rr-codes commented Feb 10, 2023

887ab6d

REGRESSION: sreality.cz: pinch zooming on maps causes tab to enter Tab Overview instead of interacting with map
https://bugs.webkit.org/show_bug.cgi?id=252023
rdar://104329203

Reviewed by Wenson Hsieh.

b7a998f introduced a new deferring gesture recognizer
for pan and pinch gestures. This had the conseequence of now letting Safari take
precedence over consuming these gestures rather than WebKit, causing the tab overview
to appear instead of zooming out of the map.

This PR adds a new private delegate method to `WKUIDelegate` that allows clients to specify
if a recognizer can be prevented by touch events. Then, if the gesture is also one that is
installed over the web view, the web view will take precedence.

* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _gestureRecognizerCanBePreventedByTouchEvents:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

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

85bb734

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 loading πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@rr-codes rr-codes self-assigned this Feb 10, 2023
@rr-codes rr-codes added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label Feb 10, 2023
Comment on lines 1769 to 1770
if (!uiDelegate)
return NO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is unnecessary. If uiDelegate is nil, the respondsToSelector check below will fail.

The method could just return [uiDelegate respondsToSelector:@selector(_webView:gestureRecognizerCanBePreventedByTouchEvents:)] && [uiDelegate _webView:self.webView gestureRecognizerCanBePreventedByTouchEvents:gestureRecognizer].

@rr-codes rr-codes force-pushed the eng/104329203 branch 2 times, most recently from 8d7b745 to c0f02f9 Compare February 14, 2023 19:20
@rr-codes rr-codes added the merge-queue Applied to send a pull request to merge-queue label Feb 15, 2023
…b Overview instead of interacting with map

https://bugs.webkit.org/show_bug.cgi?id=252023
rdar://104329203

Reviewed by Wenson Hsieh.

WebKit@b7a998f introduced a new deferring gesture recognizer
for pan and pinch gestures. This had the conseequence of now letting Safari take
precedence over consuming these gestures rather than WebKit, causing the tab overview
to appear instead of zooming out of the map.

This PR adds a new private delegate method to `WKUIDelegate` that allows clients to specify
if a recognizer can be prevented by touch events. Then, if the gesture is also one that is
installed over the web view, the web view will take precedence.

* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _gestureRecognizerCanBePreventedByTouchEvents:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

Canonical link: https://commits.webkit.org/260294@main
@webkit-commit-queue
Copy link
Collaborator

Committed 260294@main (887ab6d): https://commits.webkit.org/260294@main

Reviewed commits have been landed. Closing PR #9901 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 15, 2023
@webkit-early-warning-system webkit-early-warning-system merged commit 887ab6d into WebKit:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Portability improvements and other general platform improvements not driven directly by site bugs.
Projects
None yet
5 participants