Commit 7b60c3f
committed
[iOS] Active pointer map may fail to clear in presence of external gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=306373
rdar://159227684
Reviewed by Abrar Rahman Protyasha.
When a WKWebView is the subview of a parent view which itself has a custom
gesture recognizer, the custom gesture recognizer may block gestures in such
a way that `touchesBegan` fires for WebKit's touch gesture recognizer, but
not `touchesEnded` or `touchesCancelled`. When this happens, we add an active
pointer to the map in PointerCaptureController but never clear it since we
never received a notification that the touch ended or was otherwise cancelled.
When an active touch is present in the map, we do not create pointer events
in `PointerCaptureController::pointerEventForMouseEvent`, so if the parent
view later stops blocking touch gestures, WebKit may continue to fail to
dispatch pointer and click events afterward.
Resolve this by clearing the active pointer map when `reset` is called for
`WKTouchEventsGestureRecognizer`.
* Source/WebCore/page/PointerCaptureController.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetPointerCapture):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _touchEventsGestureRecognizerReset]):
* Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.mm:
(-[WKTouchEventsGestureRecognizer reset]):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::resetPointerCapture):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
Canonical link: https://commits.webkit.org/306362@main1 parent 19a4329 commit 7b60c3f
9 files changed
Lines changed: 22 additions & 1 deletion
File tree
- Source
- WebCore/page
- WebKit
- UIProcess
- ios
- WebProcess/WebPage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4895 | 4895 | | |
4896 | 4896 | | |
4897 | 4897 | | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
4898 | 4903 | | |
4899 | 4904 | | |
4900 | 4905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
| 1443 | + | |
1443 | 1444 | | |
1444 | 1445 | | |
1445 | 1446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
| 1032 | + | |
1032 | 1033 | | |
1033 | 1034 | | |
1034 | 1035 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2273 | 2273 | | |
2274 | 2274 | | |
2275 | 2275 | | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
2276 | 2281 | | |
2277 | 2282 | | |
2278 | 2283 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4015 | 4015 | | |
4016 | 4016 | | |
4017 | 4017 | | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
4018 | 4023 | | |
4019 | 4024 | | |
4020 | 4025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2305 | 2305 | | |
2306 | 2306 | | |
2307 | 2307 | | |
| 2308 | + | |
2308 | 2309 | | |
2309 | 2310 | | |
2310 | 2311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
0 commit comments