Changeset 228016 in webkit


Ignore:
Timestamp:
Feb 2, 2018 9:44:36 AM (6 years ago)
Author:
Wenson Hsieh
Message:

[Extra Zoom Mode] Implement support for indirect mainframe scrolling
https://bugs.webkit.org/show_bug.cgi?id=182421
<rdar://problem/35142694>

Reviewed by Tim Horton.

Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
zooming. See below for more details.

  • UIProcess/API/Cocoa/WKWebView.mm:

Remove a now-unneeded WebKitAdditions import.

  • UIProcess/ios/WKScrollView.mm:

(-[WKScrollView initWithFrame:]):

Add imports for -Before and -After versions of WKScrollViewAdditions.

(-[WKScrollView addGestureRecognizer:]):

Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
-initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r227993 r228016  
     12018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [Extra Zoom Mode] Implement support for indirect mainframe scrolling
     4        https://bugs.webkit.org/show_bug.cgi?id=182421
     5        <rdar://problem/35142694>
     6
     7        Reviewed by Tim Horton.
     8
     9        Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
     10        zooming. See below for more details.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13
     14        Remove a now-unneeded WebKitAdditions import.
     15
     16        * UIProcess/ios/WKScrollView.mm:
     17        (-[WKScrollView initWithFrame:]):
     18
     19        Add imports for -Before and -After versions of WKScrollViewAdditions.
     20
     21        (-[WKScrollView addGestureRecognizer:]):
     22
     23        Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
     24        I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
     25        recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
     26        -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.
     27
    1282018-02-01  Tim Horton  <timothy_horton@apple.com>
    229
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r227869 r228016  
    63416341@end
    63426342
    6343 #if USE(APPLE_INTERNAL_SDK)
    6344 #import <WebKitAdditions/WKWebViewAdditionsAfter.mm>
    6345 #endif
    6346 
    63476343#endif // WK_API_ENABLED
  • trunk/Source/WebKit/UIProcess/ios/WKScrollView.mm

    r220506 r228016  
    3535using namespace WebKit;
    3636
     37#if USE(APPLE_INTERNAL_SDK)
     38#import <WebKitAdditions/WKScrollViewAdditionsBefore.mm>
     39#endif
     40
    3741@interface UIScrollView (UIScrollViewInternalHack)
    3842- (CGFloat)_rubberBandOffsetForOffset:(CGFloat)newOffset maxOffset:(CGFloat)maxOffset minOffset:(CGFloat)minOffset range:(CGFloat)range outside:(BOOL *)outside;
     
    135139#endif
    136140   
     141#if ENABLE(EXTRA_ZOOM_MODE)
     142    [self _configureScrollingForExtraZoomMode];
     143#endif
     144
    137145    return self;
    138146}
     
    312320}
    313321
     322- (void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
     323{
     324    [super addGestureRecognizer:gestureRecognizer];
     325
     326#if ENABLE(EXTRA_ZOOM_MODE)
     327    if (gestureRecognizer == self.pinchGestureRecognizer)
     328        gestureRecognizer.allowedTouchTypes = @[];
     329#endif
     330}
     331
     332#if USE(APPLE_INTERNAL_SDK)
     333#import <WebKitAdditions/WKScrollViewAdditionsAfter.mm>
     334#endif
     335
    314336@end
    315337
Note: See TracChangeset for help on using the changeset viewer.