Title: [285431] trunk/Source/WebKit
- Revision
- 285431
- Author
- [email protected]
- Date
- 2021-11-08 14:16:44 -0800 (Mon, 08 Nov 2021)
Log Message
WKSyntheticTapGestureRecognizer's action targets should be weak pointers
https://bugs.webkit.org/show_bug.cgi?id=232812
Reviewed by Tim Horton.
Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
"reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
* UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
(-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
now that __weak is enabled in WebKit2.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (285430 => 285431)
--- trunk/Source/WebKit/ChangeLog 2021-11-08 21:52:43 UTC (rev 285430)
+++ trunk/Source/WebKit/ChangeLog 2021-11-08 22:16:44 UTC (rev 285431)
@@ -1,3 +1,19 @@
+2021-11-08 Wenson Hsieh <[email protected]>
+
+ WKSyntheticTapGestureRecognizer's action targets should be weak pointers
+ https://bugs.webkit.org/show_bug.cgi?id=232812
+
+ Reviewed by Tim Horton.
+
+ Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
+ "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
+
+ * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
+ (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
+
+ Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
+ now that __weak is enabled in WebKit2.
+
2021-11-08 Devin Rousso <[email protected]>
webView.scrollView.indicatorStyle does not work on iOS 15
Modified: trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm (285430 => 285431)
--- trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm 2021-11-08 21:52:43 UTC (rev 285430)
+++ trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm 2021-11-08 22:16:44 UTC (rev 285431)
@@ -30,17 +30,16 @@
#import <UIKit/UIGestureRecognizerSubclass.h>
#import <wtf/RetainPtr.h>
-#import <wtf/WeakObjCPtr.h>
@implementation WKSyntheticTapGestureRecognizer {
- id _gestureIdentifiedTarget;
+ __weak id _gestureIdentifiedTarget;
SEL _gestureIdentifiedAction;
- id _gestureFailedTarget;
+ __weak id _gestureFailedTarget;
SEL _gestureFailedAction;
- id _resetTarget;
+ __weak id _resetTarget;
SEL _resetAction;
RetainPtr<NSNumber> _lastActiveTouchIdentifier;
- WeakObjCPtr<UIScrollView> _lastTouchedScrollView;
+ __weak UIScrollView *_lastTouchedScrollView;
}
- (void)setGestureIdentifiedTarget:(id)target action:(SEL)action
@@ -108,7 +107,7 @@
- (UIScrollView *)lastTouchedScrollView
{
- return _lastTouchedScrollView.get().get();
+ return _lastTouchedScrollView;
}
- (NSNumber*)lastActiveTouchIdentifier
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes