Changeset 247073 in webkit


Ignore:
Timestamp:
Jul 2, 2019 3:04:10 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

REGRESSION (r243240): Unable to swipe back in Safari
https://bugs.webkit.org/show_bug.cgi?id=199394
<rdar://problem/51137447>

Reviewed by Wenson Hsieh.

Source/WebKit:

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _processDidExit]):
r243240 started nilling out the ViewGestureController, but we don't actually
expect that; the only time WKWebView's ViewGestureController goes away
is if the client turns off the gestures... and so nothing ever puts it back.
Instead, just always disconnect, don't nil it out.

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Make sure that we actually end up with swipe gesture recognizers installed
after process swap and crash.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247072 r247073  
     12019-07-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r243240): Unable to swipe back in Safari
     4        https://bugs.webkit.org/show_bug.cgi?id=199394
     5        <rdar://problem/51137447>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        * UIProcess/API/Cocoa/WKWebView.mm:
     10        (-[WKWebView _processDidExit]):
     11        r243240 started nilling out the ViewGestureController, but we don't actually
     12        expect that; the only time WKWebView's ViewGestureController goes away
     13        is if the client turns off the gestures... and so nothing ever puts it back.
     14        Instead, just always disconnect, don't nil it out.
     15
    1162019-07-02  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r246947 r247073  
    18491849    [self _cancelAnimatedResize];
    18501850
     1851    if (_gestureController)
     1852        _gestureController->disconnectFromProcess();
     1853
    18511854    _viewportMetaTagWidth = WebCore::ViewportArguments::ValueAuto;
    18521855    _initialScaleFactor = 1;
     
    18841887    RELEASE_LOG_IF_ALLOWED("%p -[WKWebView _processWillSwap]", self);
    18851888    [self _processWillSwapOrDidExit];
    1886     if (_gestureController)
    1887         _gestureController->disconnectFromProcess();
    18881889}
    18891890
     
    18981899    [_scrollView setContentOffset:[self _initialContentOffsetForScrollView]];
    18991900    [_scrollView setZoomScale:1];
    1900     _gestureController = nullptr;
    19011901}
    19021902
  • trunk/Tools/ChangeLog

    r247071 r247073  
     12019-07-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r243240): Unable to swipe back in Safari
     4        https://bugs.webkit.org/show_bug.cgi?id=199394
     5        <rdar://problem/51137447>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
     10        Make sure that we actually end up with swipe gesture recognizers installed
     11        after process swap and crash.
     12
    1132019-07-02  Andres Gonzalez  <andresg_22@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r246694 r247073  
    53515351}
    53525352
     5353#if PLATFORM(IOS_FAMILY)
     5354static bool viewHasSwipeGestures(UIView *view)
     5355{
     5356    unsigned swipeGestureCount = 0;
     5357    for (UIGestureRecognizer *recognizer in view.gestureRecognizers) {
     5358        if ([recognizer isKindOfClass:NSClassFromString(@"UIScreenEdgePanGestureRecognizer")])
     5359            swipeGestureCount++;
     5360    }
     5361
     5362    return swipeGestureCount == 2;
     5363}
     5364#endif
     5365
    53535366TEST(ProcessSwap, SwapWithGestureController)
    53545367{
     
    53845397        TestWebKitAPI::Util::run(&done);
    53855398        done = false;
     5399
     5400#if PLATFORM(IOS_FAMILY)
     5401        EXPECT_TRUE(viewHasSwipeGestures(webView.get()));
     5402#endif
    53865403    }
    53875404}
     
    54325449        TestWebKitAPI::Util::run(&done);
    54335450        done = false;
     5451
     5452#if PLATFORM(IOS_FAMILY)
     5453        EXPECT_TRUE(viewHasSwipeGestures(webView.get()));
     5454#endif
    54345455    }
    54355456}
Note: See TracChangeset for help on using the changeset viewer.