Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (226857 => 226858)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-12 04:53:02 UTC (rev 226858)
@@ -1,5 +1,23 @@
2018-01-11 Jason Marcell <[email protected]>
+ Cherry-pick r226750. rdar://problem/36429156
+
+ 2018-01-10 Tim Horton <[email protected]>
+
+ REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
+ https://bugs.webkit.org/show_bug.cgi?id=181269
+ <rdar://problem/35110344>
+
+ Reviewed by Simon Fraser.
+
+ * swipe/pushstate-with-manual-scrollrestoration-expected.txt: Added.
+ * swipe/pushstate-with-manual-scrollrestoration.html: Added.
+ Add a test (which previously would complain about taking too long)
+ that using manual scroll position restoration and pushState together
+ doesn't cause swipes to hang until the watchdog fires.
+
+2018-01-11 Jason Marcell <[email protected]>
+
Cherry-pick r226677. rdar://problem/36429157
2018-01-09 Chris Dumez <[email protected]>
Modified: branches/safari-605-branch/LayoutTests/platform/mac/TestExpectations (226857 => 226858)
--- branches/safari-605-branch/LayoutTests/platform/mac/TestExpectations 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/LayoutTests/platform/mac/TestExpectations 2018-01-12 04:53:02 UTC (rev 226858)
@@ -1758,3 +1758,5 @@
webkit.org/b/180675 accessibility/mac/search-field-cancel-button.html [ Pass Failure ]
webkit.org/b/181098 fast/workers/worker-terminate.html [ Pass Timeout ]
+
+webkit.org/b/181502 swipe/pushstate-with-manual-scrollrestoration.html [ Failure ]
\ No newline at end of file
Added: branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration-expected.txt (0 => 226858)
--- branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration-expected.txt (rev 0)
+++ branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration-expected.txt 2018-01-12 04:53:02 UTC (rev 226858)
@@ -0,0 +1,6 @@
+startSwipeGesture
+didBeginSwipe
+completeSwipeGesture
+didEndSwipe
+didRemoveSwipeSnapshot
+
Added: branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html (0 => 226858)
--- branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html (rev 0)
+++ branches/safari-605-branch/LayoutTests/swipe/pushstate-with-manual-scrollrestoration.html 2018-01-12 04:53:02 UTC (rev 226858)
@@ -0,0 +1,60 @@
+<head>
+<style>
+html {
+ font-size: 32pt;
+}
+</style>
+<script src=""
+<script>
+history.scrollRestoration = "manual";
+
+function didBeginSwipeCallback()
+{
+ log("didBeginSwipe");
+
+ completeSwipeGesture();
+}
+
+function didEndSwipeCallback()
+{
+ log("didEndSwipe");
+
+ startMeasuringDuration("snapshotRemoval");
+}
+
+function didRemoveSwipeSnapshotCallback()
+{
+ log("didRemoveSwipeSnapshot");
+
+ measuredDurationShouldBeLessThan("snapshotRemoval", 1000, "Because we're using the page cache, it shouldn't be long between the gesture completing and the snapshot being removed.")
+
+ testComplete();
+}
+
+window._onload_ = function () {
+ if (!window.eventSender || !window.testRunner) {
+ document.body.innerHTML = "This test must be run in WebKitTestRunner.";
+ return;
+ }
+
+ initializeSwipeTest();
+
+ testRunner.installDidBeginSwipeCallback(didBeginSwipeCallback);
+ testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
+ testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
+
+ testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+
+ setTimeout(function () {
+ history.pushState({page: "second"}, "second", "?second");
+ document.body.innerHTML = "second";
+ startSwipeGesture();
+ }, 0);
+};
+</script>
+</head>
+<body>
+first
+</body>
\ No newline at end of file
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-12 04:53:02 UTC (rev 226858)
@@ -1,5 +1,54 @@
2018-01-11 Jason Marcell <[email protected]>
+ Cherry-pick r226750. rdar://problem/36429156
+
+ 2018-01-10 Tim Horton <[email protected]>
+
+ REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
+ https://bugs.webkit.org/show_bug.cgi?id=181269
+ <rdar://problem/35110344>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _processDidExit]):
+ (-[WKWebView _didCommitLayerTree:]):
+ When swiping to a page that set history.scrollRestoration = "manual",
+ we will never restore the scroll position. We will still restore
+ "state", but won't have a location. Currently, the code assumes that
+ it should wait to remove the swipe snapshot until the scroll position
+ is restored. Instead, wait until the "state" is restored, whether
+ or not that includes a scroll position/center point restoration.
+
+ Do this by making _firstTransactionIDAfterPageRestore an optional,
+ and reset it after it fires, so that we only run the restoration code
+ in _didCommitLayerTree for the first commit after state restoration,
+ not all subsequent commits. Then, tell ViewGestureController that
+ the scroll position has been restored even if the page opted out.
+
+ The reason that this is specific to pushState is that normal,
+ non-same-document loads bail from waiting for the scroll position
+ restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
+ comment there for an explanation).
+
+ (-[WKWebView _beginBackSwipeForTesting]):
+ (-[WKWebView _completeBackSwipeForTesting]):
+ * Platform/spi/ios/UIKitSPI.h:
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/Cocoa/ViewGestureController.h:
+ * UIProcess/ios/ViewGestureControllerIOS.mm:
+ (-[WKSwipeTransitionController transitionForDirection:]):
+ (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
+ (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
+ * UIProcess/mac/ViewGestureControllerMac.mm:
+ (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
+ (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
+ Add a mechanism to forcefully test swipe back. Instead of simulating
+ events like on Mac, we just talk to the UIKit internals and force
+ the interaction to start, pause, and then complete when we want.
+
+2018-01-11 Jason Marcell <[email protected]>
+
Cherry-pick r226742. rdar://problem/36429136
2018-01-10 Brent Fulgham <[email protected]>
Modified: branches/safari-605-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2018-01-12 04:53:02 UTC (rev 226858)
@@ -772,6 +772,7 @@
@interface _UINavigationInteractiveTransitionBase ()
- (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
+- (void)_completeStoppedInteractiveTransition;
@property (nonatomic, weak) UIPanGestureRecognizer *gestureRecognizer;
@property (nonatomic, assign) BOOL shouldReverseTranslation;
@property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
@@ -970,6 +971,10 @@
- (UIResponder *)firstResponder;
@end
+@interface _UINavigationInteractiveTransitionBase ()
+- (void)_stopInteractiveTransition;
+@end
+
#if __has_include(<UIKit/UITextAutofillSuggestion.h>)
#import <UIKit/UITextAutofillSuggestion.h>
#else
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -318,7 +318,7 @@
WebCore::FloatBoxExtent _obscuredInsetsWhenSaved;
std::optional<WebCore::FloatPoint> _unobscuredCenterToRestore;
- uint64_t _firstTransactionIDAfterPageRestore;
+ std::optional<uint64_t> _firstTransactionIDAfterPageRestore;
double _scaleToRestore;
std::unique_ptr<WebKit::ViewGestureController> _gestureController;
@@ -1615,7 +1615,7 @@
_frozenUnobscuredContentRect = std::nullopt;
_firstPaintAfterCommitLoadTransactionID = 0;
- _firstTransactionIDAfterPageRestore = 0;
+ _firstTransactionIDAfterPageRestore = std::nullopt;
_resizeAnimationTransformTransactionID = std::nullopt;
_hasScheduledVisibleRectUpdate = NO;
@@ -1737,8 +1737,7 @@
needUpdateVisibleContentRects = true;
}
- if (layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore) {
- bool shouldRestoreScrollPosition = false;
+ if (_firstTransactionIDAfterPageRestore && layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore.value()) {
if (_scrollOffsetToRestore) {
WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore.value();
_scrollOffsetToRestore = std::nullopt;
@@ -1749,8 +1748,6 @@
changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
_commitDidRestoreScrollPosition = YES;
-
- shouldRestoreScrollPosition = true;
}
needUpdateVisibleContentRects = true;
@@ -1769,15 +1766,15 @@
topLeftInDocumentCoordinates.moveBy(WebCore::FloatPoint(-_obscuredInsets.left, -_obscuredInsets.top));
changeContentOffsetBoundedInValidRange(_scrollView.get(), topLeftInDocumentCoordinates);
-
- shouldRestoreScrollPosition = true;
}
needUpdateVisibleContentRects = true;
}
- if (shouldRestoreScrollPosition && _gestureController)
+ if (_gestureController)
_gestureController->didRestoreScrollPosition();
+
+ _firstTransactionIDAfterPageRestore = std::nullopt;
}
if (needUpdateVisibleContentRects)
@@ -6167,6 +6164,28 @@
#endif // PLATFORM(IOS)
+- (BOOL)_beginBackSwipeForTesting
+{
+#if PLATFORM(MAC)
+ return _impl->beginBackSwipeForTesting();
+#else
+ if (!_gestureController)
+ return NO;
+ return _gestureController->beginSimulatedSwipeInDirectionForTesting(WebKit::ViewGestureController::SwipeDirection::Back);
+#endif
+}
+
+- (BOOL)_completeBackSwipeForTesting
+{
+#if PLATFORM(MAC)
+ return _impl->completeBackSwipeForTesting();
+#else
+ if (!_gestureController)
+ return NO;
+ return _gestureController->completeSimulatedSwipeInDirectionForTesting(WebKit::ViewGestureController::SwipeDirection::Back);
+#endif
+}
+
@end
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2018-01-12 04:53:02 UTC (rev 226858)
@@ -454,6 +454,9 @@
- (void)_disableBackForwardSnapshotVolatilityForTesting WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
- (void)_executeEditCommand:(NSString *)command argument:(NSString *)argument completion:(void (^)(BOOL))completion WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (BOOL)_beginBackSwipeForTesting;
+- (BOOL)_completeBackSwipeForTesting;
+
@end
#endif
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h 2018-01-12 04:53:02 UTC (rev 226858)
@@ -135,6 +135,10 @@
void removeSwipeSnapshot();
+ // Testing
+ bool beginSimulatedSwipeInDirectionForTesting(SwipeDirection);
+ bool completeSimulatedSwipeInDirectionForTesting(SwipeDirection);
+
private:
// IPC::MessageReceiver.
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2018-01-12 04:53:02 UTC (rev 226858)
@@ -537,6 +537,9 @@
void prepareToDragPromisedBlob(const WebCore::PromisedBlobInfo&);
+ bool beginBackSwipeForTesting();
+ bool completeBackSwipeForTesting();
+
private:
#if HAVE(TOUCH_BAR)
void setUpTextTouchBar(NSTouchBar *);
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -4943,6 +4943,20 @@
m_page->setUserInterfaceLayoutDirection(toUserInterfaceLayoutDirection(direction));
}
+bool WebViewImpl::beginBackSwipeForTesting()
+{
+ if (!m_gestureController)
+ return false;
+ return m_gestureController->beginSimulatedSwipeInDirectionForTesting(ViewGestureController::SwipeDirection::Back);
+}
+
+bool WebViewImpl::completeBackSwipeForTesting()
+{
+ if (!m_gestureController)
+ return false;
+ return m_gestureController->completeSimulatedSwipeInDirectionForTesting(ViewGestureController::SwipeDirection::Back);
+}
+
} // namespace WebKit
#endif // PLATFORM(MAC)
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -50,6 +50,8 @@
@interface WKSwipeTransitionController : NSObject <_UINavigationInteractiveTransitionBaseDelegate>
- (instancetype)initWithViewGestureController:(WebKit::ViewGestureController*)gestureController gestureRecognizerView:(UIView *)gestureRecognizerView;
- (void)invalidate;
+
+- (_UINavigationInteractiveTransitionBase *)transitionForDirection:(WebKit::ViewGestureController::SwipeDirection)direction;
@end
@interface _UIViewControllerTransitionContext (WKDetails)
@@ -93,6 +95,11 @@
return transition == _backTransitionController ? WebKit::ViewGestureController::SwipeDirection::Back : WebKit::ViewGestureController::SwipeDirection::Forward;
}
+- (_UINavigationInteractiveTransitionBase *)transitionForDirection:(WebKit::ViewGestureController::SwipeDirection)direction
+{
+ return direction == WebKit::ViewGestureController::SwipeDirection::Back ? _backTransitionController.get() : _forwardTransitionController.get();
+}
+
- (void)startInteractiveTransition:(_UINavigationInteractiveTransitionBase *)transition
{
_gestureController->beginSwipeGesture(transition, [self directionForTransition:transition]);
@@ -361,6 +368,26 @@
didEndGesture();
}
+bool ViewGestureController::beginSimulatedSwipeInDirectionForTesting(SwipeDirection direction)
+{
+ if (!canSwipeInDirection(direction))
+ return false;
+
+ _UINavigationInteractiveTransitionBase *transition = [m_swipeInteractiveTransitionDelegate transitionForDirection:direction];
+ beginSwipeGesture(transition, direction);
+ [transition _stopInteractiveTransition];
+
+ return true;
+}
+
+bool ViewGestureController::completeSimulatedSwipeInDirectionForTesting(SwipeDirection direction)
+{
+ _UINavigationInteractiveTransitionBase *transition = [m_swipeInteractiveTransitionDelegate transitionForDirection:direction];
+ [transition _completeStoppedInteractiveTransition];
+
+ return true;
+}
+
} // namespace WebKit
#endif // PLATFORM(IOS)
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm (226857 => 226858)
--- branches/safari-605-branch/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -43,6 +43,7 @@
#import "WebProcessProxy.h"
#import <Cocoa/Cocoa.h>
#import <WebCore/IOSurface.h>
+#import <WebCore/NotImplemented.h>
#import <WebCore/WebActionDisablingCALayerDelegate.h>
#import <pal/spi/cocoa/QuartzCoreSPI.h>
#import <pal/spi/mac/NSEventSPI.h>
@@ -820,6 +821,18 @@
return m_webPageProxy.pageScaleFactor();
}
+bool ViewGestureController::beginSimulatedSwipeInDirectionForTesting(SwipeDirection)
+{
+ notImplemented();
+ return false;
+}
+
+bool ViewGestureController::completeSimulatedSwipeInDirectionForTesting(SwipeDirection)
+{
+ notImplemented();
+ return false;
+}
+
} // namespace WebKit
#endif // PLATFORM(MAC)
Modified: branches/safari-605-branch/Tools/ChangeLog (226857 => 226858)
--- branches/safari-605-branch/Tools/ChangeLog 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Tools/ChangeLog 2018-01-12 04:53:02 UTC (rev 226858)
@@ -1,5 +1,33 @@
2018-01-11 Jason Marcell <[email protected]>
+ Cherry-pick r226750. rdar://problem/36429156
+
+ 2018-01-10 Tim Horton <[email protected]>
+
+ REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
+ https://bugs.webkit.org/show_bug.cgi?id=181269
+ <rdar://problem/35110344>
+
+ Reviewed by Simon Fraser.
+
+ * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::beginBackSwipe):
+ (WTR::UIScriptController::completeBackSwipe):
+ * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+ (WTR::UIScriptController::beginBackSwipe):
+ (WTR::UIScriptController::completeBackSwipe):
+ (WTR::UIScriptController::overridePreference):
+ (WTR::UIScriptController::replaceTextAtRange):
+ * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+ (WTR::PlatformWebView::setNavigationGesturesEnabled):
+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::beginBackSwipe):
+ (WTR::UIScriptController::completeBackSwipe):
+ Implement beginBackSwipe and completeBackSwipe on iOS (they already
+ exist on Mac) in terms of the new WKWebView testing SPI.
+
+2018-01-11 Jason Marcell <[email protected]>
+
Cherry-pick r226668. rdar://problem/36429139
2018-01-09 Myles C. Maxfield <[email protected]>
Modified: branches/safari-605-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (226857 => 226858)
--- branches/safari-605-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -335,6 +335,14 @@
{
}
+void UIScriptController::beginBackSwipe(JSValueRef callback)
+{
}
+void UIScriptController::completeBackSwipe(JSValueRef callback)
+{
+}
+
+}
+
#endif // PLATFORM(IOS)
Modified: branches/safari-605-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (226857 => 226858)
--- branches/safari-605-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2018-01-12 04:53:02 UTC (rev 226858)
@@ -457,6 +457,14 @@
{
}
+void UIScriptController::beginBackSwipe(JSValueRef callback)
+{
+}
+
+void UIScriptController::completeBackSwipe(JSValueRef callback)
+{
+}
+
#endif // !PLATFORM(COCOA)
#if !PLATFORM(MAC)
@@ -469,14 +477,6 @@
{
}
-void UIScriptController::beginBackSwipe(JSValueRef callback)
-{
-}
-
-void UIScriptController::completeBackSwipe(JSValueRef callback)
-{
-}
-
void UIScriptController::platformPlayBackEventStream(JSStringRef, JSValueRef)
{
}
Modified: branches/safari-605-branch/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (226857 => 226858)
--- branches/safari-605-branch/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -356,6 +356,9 @@
void PlatformWebView::setNavigationGesturesEnabled(bool enabled)
{
+#if WK_API_ENABLED
+ [platformView() setAllowsBackForwardNavigationGestures:enabled];
+#endif
}
} // namespace WTR
Modified: branches/safari-605-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (226857 => 226858)
--- branches/safari-605-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2018-01-12 04:52:55 UTC (rev 226857)
+++ branches/safari-605-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2018-01-12 04:53:02 UTC (rev 226858)
@@ -749,6 +749,24 @@
webView.overrideSafeAreaInsets = insets;
}
+void UIScriptController::beginBackSwipe(JSValueRef callback)
+{
+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+ [webView _beginBackSwipeForTesting];
+
+ unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+ m_context->asyncTaskComplete(callbackID);
}
+void UIScriptController::completeBackSwipe(JSValueRef callback)
+{
+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+ [webView _completeBackSwipeForTesting];
+
+ unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+ m_context->asyncTaskComplete(callbackID);
+}
+
+}
+
#endif // PLATFORM(IOS)