[iPadOS] slides.google.com: Full Screen API warning is presented when swiping through...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 20:09:06 +0000 (20:09 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 20:09:06 +0000 (20:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200313
<rdar://problem/53777001>

Reviewed by Eric Carlson.

Only run the secheuristic scoring during UIGestureRecognizerStateEnded, rather than both
UIGestureRecognizerStateEnded and UIGestureRecognizerStateBegan. The goal of the heuristic is
to detect fake on-screen keyboards by detecting gestures that look like "typing". Using only
UIGestureRecognizerStateEnded still allows us to do this (as typing will usually have identical
geometries for both Ended and Began) without generating false-positives during swipe gestures.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _touchDetected:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248174 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm

index 6518be7..af872aa 100644 (file)
@@ -1,3 +1,20 @@
+2019-08-02  Jer Noble  <jer.noble@apple.com>
+
+        [iPadOS] slides.google.com: Full Screen API warning is presented when swiping through slides
+        https://bugs.webkit.org/show_bug.cgi?id=200313
+        <rdar://problem/53777001>
+
+        Reviewed by Eric Carlson.
+
+        Only run the secheuristic scoring during UIGestureRecognizerStateEnded, rather than both
+        UIGestureRecognizerStateEnded and UIGestureRecognizerStateBegan. The goal of the heuristic is
+        to detect fake on-screen keyboards by detecting gestures that look like "typing". Using only
+        UIGestureRecognizerStateEnded still allows us to do this (as typing will usually have identical
+        geometries for both Ended and Began) without generating false-positives during swipe gestures.
+
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+        (-[WKFullScreenViewController _touchDetected:]):
+
 2019-08-02  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [macOS 10.15] Image dragged from Safari does not appear in Notes
index 12ab1df..267be53 100644 (file)
@@ -529,7 +529,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
 - (void)_touchDetected:(id)sender
 {
-    if ([_touchGestureRecognizer state] == UIGestureRecognizerStateBegan || [_touchGestureRecognizer state] == UIGestureRecognizerStateEnded) {
+    if ([_touchGestureRecognizer state] == UIGestureRecognizerStateEnded) {
         double score = _secheuristic.scoreOfNextTouch([_touchGestureRecognizer locationInView:self.view]);
         if (score > requiredScore)
             [self _showPhishingAlert];