Bug 186821 - [Fullscreen] Add a pinch-to-exit gesture
Summary: [Fullscreen] Add a pinch-to-exit gesture
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-19 14:51 PDT by Jer Noble
Modified: 2018-06-22 15:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (15.47 KB, patch)
2018-06-19 15:08 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (15.41 KB, patch)
2018-06-21 10:59 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.24 MB, application/zip)
2018-06-21 12:35 PDT, EWS Watchlist
no flags Details
Patch for landing (15.76 KB, patch)
2018-06-22 14:45 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2018-06-19 14:51:08 PDT
[Fullscreen] Add a pinch-to-exit gesture
Comment 1 Jer Noble 2018-06-19 15:08:13 PDT
Created attachment 343108 [details]
Patch
Comment 2 Jer Noble 2018-06-20 15:03:14 PDT
<rdar://problem/41212279>
Comment 3 Simon Fraser (smfr) 2018-06-20 17:24:50 PDT
Comment on attachment 343108 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343108&action=review

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:289
> +    progressTransform.a *= scale;
> +    progressTransform.b *= scale;
> +    progressTransform.c *= scale;
> +    progressTransform.d *= scale;

What? Scale is just in a and d.  And why not just use CGAffineTransformScale?
Comment 4 Jer Noble 2018-06-20 18:16:22 PDT
Comment on attachment 343108 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343108&action=review

>> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:289
>> +    progressTransform.d *= scale;
> 
> What? Scale is just in a and d.  And why not just use CGAffineTransformScale?

Doesn’t matter much since b and c will always be zero. But yes I’ll use CGAffineTransformscale here.
Comment 5 Jer Noble 2018-06-21 10:59:14 PDT
Created attachment 343248 [details]
Patch
Comment 6 EWS Watchlist 2018-06-21 12:35:10 PDT
Comment on attachment 343248 [details]
Patch

Attachment 343248 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/8279500

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/formdata.htm
Comment 7 EWS Watchlist 2018-06-21 12:35:12 PDT
Created attachment 343257 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 8 Tim Horton 2018-06-22 13:25:56 PDT
Comment on attachment 343248 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343248&action=review

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h:43
> +@property (assign, nonatomic) BOOL animating;

should the getter be ‘isAnimating’? :P

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:787
> +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];
> +        else if (_interactivePinchDismissGestureRecognizer.get().state == UIGestureRecognizerStateBegan)
> +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];

You seem to be repeating yourself. Maybe these cases should be ||’d?

> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:984
> +        if (progress > 0.25 || (progress > 0 && velocity > 5))

Is this what other people usually use? I feel like I’ve seen fancier things.
Comment 9 Tim Horton 2018-06-22 13:26:44 PDT
Comment on attachment 343248 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343248&action=review

>> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:787
>> +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];
> 
> You seem to be repeating yourself. Maybe these cases should be ||’d?

Or the second one should be pinch? I’m not sure.
Comment 10 Jer Noble 2018-06-22 14:05:16 PDT
(In reply to Tim Horton from comment #9)
> Comment on attachment 343248 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=343248&action=review
> 
> >> Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:787
> >> +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];
> > 
> > You seem to be repeating yourself. Maybe these cases should be ||’d?
> 
> Or the second one should be pinch? I’m not sure.

The second one should be pinch.
Comment 11 Jer Noble 2018-06-22 14:18:48 PDT
(In reply to Tim Horton from comment #8)
> Comment on attachment 343248 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=343248&action=review
> 
> > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h:43
> > +@property (assign, nonatomic) BOOL animating;
> 
> should the getter be ‘isAnimating’? :P

Probably should.

> > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:787
> > +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];
> > +        else if (_interactivePinchDismissGestureRecognizer.get().state == UIGestureRecognizerStateBegan)
> > +            anchor = [_interactivePanDismissGestureRecognizer locationInView:_fullscreenViewController.get().view];
> 
> You seem to be repeating yourself. Maybe these cases should be ||’d?

This should be using the pinch recognizer in the else statement.

> > Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:984
> > +        if (progress > 0.25 || (progress > 0 && velocity > 5))
> 
> Is this what other people usually use? I feel like I’ve seen fancier things.

KISS. (I'll see what other dismiss gestures use.)
Comment 12 Jer Noble 2018-06-22 14:45:44 PDT
Created attachment 343371 [details]
Patch for landing
Comment 13 WebKit Commit Bot 2018-06-22 15:24:40 PDT
Comment on attachment 343371 [details]
Patch for landing

Clearing flags on attachment: 343371

Committed r233104: <https://trac.webkit.org/changeset/233104>
Comment 14 WebKit Commit Bot 2018-06-22 15:24:42 PDT
All reviewed patches have been landed.  Closing bug.