Rename force-press-related functions to refer to context menus, and fix a former...
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2019 02:22:45 +0000 (02:22 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2019 02:22:45 +0000 (02:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202663
<rdar://problem/52699530>

Reviewed by Dean Jackson.

Source/WebKit:

Add plumbing for contextMenu tests to function again, and rename all
relevant fuctions to more correctly reflect that this does not specifically
require a force press to activate any longer.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didShowContextMenu]):
(-[WKWebView _didDismissContextMenu]):
(-[WKWebView _didShowForcePressPreview]): Deleted.
(-[WKWebView _didDismissForcePressPreview]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:didDismissPreview:committing:]):
(-[WKContentView _previewItemControllerDidCancelPreview:]):

Tools:

Rename all relevant fuctions to more correctly reflect that this does not specifically
require a force press to activate any longer.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptContext.h:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setDidShowContextMenuCallback):
(WTR::UIScriptController::didShowContextMenuCallback const):
(WTR::UIScriptController::setDidDismissContextMenuCallback):
(WTR::UIScriptController::didDismissContextMenuCallback const):
(WTR::UIScriptController::setDidShowForcePressPreviewCallback): Deleted.
(WTR::UIScriptController::didShowForcePressPreviewCallback const): Deleted.
(WTR::UIScriptController::setDidDismissForcePressPreviewCallback): Deleted.
(WTR::UIScriptController::didDismissForcePressPreviewCallback const): Deleted.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView resetInteractionCallbacks]):
(-[TestRunnerWKWebView _didShowContextMenu]):
(-[TestRunnerWKWebView _didDismissContextMenu]):
(-[TestRunnerWKWebView _didShowForcePressPreview]): Deleted.
(-[TestRunnerWKWebView _didDismissForcePressPreview]): Deleted.
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::setDidShowContextMenuCallback):
(WTR::UIScriptControllerIOS::setDidDismissContextMenuCallback):
(WTR::UIScriptControllerIOS::setDidShowForcePressPreviewCallback): Deleted.
(WTR::UIScriptControllerIOS::setDidDismissForcePressPreviewCallback): Deleted.

LayoutTests:

Move and rename force press test to correctly test context menu functionality.

* fast/events/touch/ios/long-press-on-link-expected.txt: Renamed from LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link-expected.txt.
* fast/events/touch/ios/long-press-on-link.html: Added.
* platform/iphone-7/fast/events/touch/force-press-on-link.html: Removed.
* resources/ui-helper.js:
(window.UIHelper.longPressAndGetContextMenuContentAt.return.new.Promise.):
(window.UIHelper.longPressAndGetContextMenuContentAt.return.new.Promise):
(window.UIHelper.longPressAndGetContextMenuContentAt):
(window.UIHelper.waitForInputSessionAt.return.new.Promise.):
(window.UIHelper.waitForInputSessionAt.return.new.Promise):
(window.UIHelper.waitForInputSessionAt):

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/long-press-on-link-expected.txt [moved from LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/long-press-on-link.html [new file with mode: 0644]
LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link.html [deleted file]
LayoutTests/resources/ui-helper.js
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Tools/ChangeLog
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

index 016ffa1..a2151d1 100644 (file)
@@ -1,3 +1,24 @@
+2019-10-23  Megan Gardner  <megan_gardner@apple.com>
+
+        Rename force-press-related functions to refer to context menus, and fix a former force-press test
+        https://bugs.webkit.org/show_bug.cgi?id=202663
+        <rdar://problem/52699530>
+
+        Reviewed by Dean Jackson.
+
+        Move and rename force press test to correctly test context menu functionality.
+
+        * fast/events/touch/ios/long-press-on-link-expected.txt: Renamed from LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link-expected.txt.
+        * fast/events/touch/ios/long-press-on-link.html: Added.
+        * platform/iphone-7/fast/events/touch/force-press-on-link.html: Removed.
+        * resources/ui-helper.js:
+        (window.UIHelper.longPressAndGetContextMenuContentAt.return.new.Promise.):
+        (window.UIHelper.longPressAndGetContextMenuContentAt.return.new.Promise):
+        (window.UIHelper.longPressAndGetContextMenuContentAt):
+        (window.UIHelper.waitForInputSessionAt.return.new.Promise.):
+        (window.UIHelper.waitForInputSessionAt.return.new.Promise):
+        (window.UIHelper.waitForInputSessionAt):
+
 2019-10-23  Simon Fraser  <simon.fraser@apple.com>
 
         Import the css/css-values web platform tests
diff --git a/LayoutTests/fast/events/touch/ios/long-press-on-link.html b/LayoutTests/fast/events/touch/ios/long-press-on-link.html
new file mode 100644 (file)
index 0000000..17461a8
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <script src="../../../../../resources/basic-gestures.js"></script>
+    <script src="../../../../../resources/ui-helper.js"></script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        async function runTest()
+        {
+            if (!testRunner.runUIScript)
+                return;
+
+            let output = '';
+            let target = document.getElementById('target');
+            let targetRect = document.getElementById('targetRect').getBoundingClientRect();
+            let pressPointX = targetRect.x + targetRect.width / 2;
+            let pressPointY = targetRect.y + targetRect.height / 2;
+
+            let result = await UIHelper.longPressAndGetContextMenuContentAt(pressPointX, pressPointY);
+            let results = JSON.parse(result).contextMenu;
+            if (results.url == 'http://localhost:54321/' && results.isLink)
+                output += 'PASS: correct page loaded in popover';
+            document.getElementById('target').innerHTML = output;
+
+            await liftUpAtPoint(pressPointX, pressPointY);
+            testRunner.notifyDone();
+        }
+
+        window.addEventListener('load', runTest, false);
+    </script>
+    <style>
+        #target {
+            height: 100px;
+            width: 200px;
+            background-color: silver;
+        }
+    </style>
+    <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+<div id="target">
+    <a id="targetRect" href="http://localhost:54321">Link Test</a>
+    This test requires UIScriptController to run.
+</div>
+</body>
+</html>
diff --git a/LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link.html b/LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link.html
deleted file mode 100644 (file)
index 29c3aa0..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-
-<html>
-<head>
-    <script>
-        if (window.testRunner) {
-            testRunner.dumpAsText();
-            testRunner.waitUntilDone();
-        }
-
-        function getUIScript()
-        {
-            return `
-            (function() {
-                var eventStream = {
-                    events : [
-                        {
-                            interpolate : "linear",
-                            timestep: 0.025,
-                            startEvent : {
-                                inputType : "hand",
-                                timeOffset : 0,
-                                touches : [
-                                    {
-                                        inputType : "finger",
-                                        phase : "began",
-                                        id : 1,
-                                        x : 20,
-                                        y : 40,
-                                        pressure : 0
-                                    }
-                                ]
-                            },
-                            endEvent : {
-                                inputType : "hand",
-                                timeOffset : 3.0,
-                                touches : [
-                                    {
-                                        inputType : "finger",
-                                        phase : "stationary",
-                                        id : 1,
-                                        x : 20,
-                                        y : 40,
-                                        pressure : 500
-                                    }
-                                ]
-                            }
-                        }
-                    ]
-                };
-
-                uiController.sendEventStream(JSON.stringify(eventStream), function() {});
-             
-                uiController.didShowForcePressPreviewCallback = function() {
-                    uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('contextMenu')));
-                };
-             
-            })();`
-        }
-    
-        function getUIFinishScript()
-        {
-            return `
-            (function() {
-                uiController.liftUpAtPoint(20, 40, 1, function() {
-                   uiController.uiScriptComplete();
-                });
-            })();`
-        }
-
-        function runTest()
-        {
-            if (!testRunner.runUIScript)
-                return;
-
-            var output = '';
-            var target = document.getElementById('target');
-            
-            if (testRunner.runUIScript) {
-                testRunner.runUIScript(getUIScript(), function(result) {
-                    var results = JSON.parse(result).contextMenu;
-                    if (results.url == 'http://localhost:54321' && results.isLink)
-                        output += 'PASS: correct page loaded in popover';
-                    document.getElementById('target').innerHTML = output;
-                                       
-                    testRunner.runUIScript(getUIFinishScript(), function() {
-                        testRunner.notifyDone();
-                    });
-               });
-            }
-        }
-
-        window.addEventListener('load', runTest, false);
-    </script>
-    <style>
-        #target {
-            height: 100px;
-            width: 200px;
-            background-color: silver;
-        }
-    </style>
-    <meta name="viewport" content="initial-scale=1">
-</head>
-<body>
-<div id="target">
-    <a href="http://localhost:54321">Link Test</a>
-    This test requires UIScriptController to run.
-</div>
-</body>
-</html>
index 3cc0931..3aaba29 100644 (file)
@@ -333,6 +333,19 @@ window.UIHelper = class UIHelper {
         });
     }
 
+    static longPressAndGetContextMenuContentAt(x, y)
+    {
+        return new Promise(resolve => {
+            testRunner.runUIScript(`
+            (function() {
+                uiController.didShowContextMenuCallback = function() {
+                    uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('contextMenu')));
+                };
+                uiController.longPressAtPoint(${x}, ${y}, function() { });
+            })();`, resolve);
+        });
+    }
+
     static activateAndWaitForInputSessionAt(x, y)
     {
         if (!this.isWebKit2() || !this.isIOSFamily())
index 1ff1e47..a61d96d 100644 (file)
@@ -1,3 +1,27 @@
+2019-10-23  Megan Gardner  <megan_gardner@apple.com>
+
+        Rename force-press-related functions to refer to context menus, and fix a former force-press test
+        https://bugs.webkit.org/show_bug.cgi?id=202663
+        <rdar://problem/52699530>
+
+        Reviewed by Dean Jackson.
+
+        Add plumbing for contextMenu tests to function again, and rename all 
+        relevant fuctions to more correctly reflect that this does not specifically
+        require a force press to activate any longer.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didShowContextMenu]):
+        (-[WKWebView _didDismissContextMenu]):
+        (-[WKWebView _didShowForcePressPreview]): Deleted.
+        (-[WKWebView _didDismissForcePressPreview]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
+        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
+        (-[WKContentView _previewItemController:didDismissPreview:committing:]):
+        (-[WKContentView _previewItemControllerDidCancelPreview:]):
+
 2019-10-23  Tim Horton  <timothy_horton@apple.com>
 
         macCatalyst: Should dispatch contextmenu event on right click
index b7abfdf..afebf3e 100644 (file)
@@ -6947,12 +6947,12 @@ static WebCore::UserInterfaceLayoutDirection toUserInterfaceLayoutDirection(UISe
     // For subclasses to override.
 }
 
-- (void)_didShowForcePressPreview
+- (void)_didShowContextMenu
 {
     // For subclasses to override.
 }
 
-- (void)_didDismissForcePressPreview
+- (void)_didDismissContextMenu
 {
     // For subclasses to override.
 }
index ce16082..3dfc6b6 100644 (file)
@@ -479,8 +479,8 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
 - (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(10.3));
 - (void)didEndFormControlInteraction WK_API_AVAILABLE(ios(10.3));
 
-- (void)_didShowForcePressPreview WK_API_AVAILABLE(ios(10.3));
-- (void)_didDismissForcePressPreview WK_API_AVAILABLE(ios(10.3));
+- (void)_didShowContextMenu WK_API_AVAILABLE(ios(10.3));
+- (void)_didDismissContextMenu WK_API_AVAILABLE(ios(10.3));
 - (void)_doAfterNextStablePresentationUpdate:(dispatch_block_t)updateBlock WK_API_AVAILABLE(ios(10.3));
 - (void)_doAfterResettingSingleTapGesture:(dispatch_block_t)action WK_API_AVAILABLE(ios(WK_IOS_TBA));
 
index 47f8425..38fae16 100644 (file)
@@ -8189,6 +8189,8 @@ static UIMenu *menuFromLegacyPreviewOrDefaultActions(UIViewController *previewVi
     if (!_webView.configuration._longPressActionsEnabled)
         return completion(nil);
 
+    [_webView _didShowContextMenu];
+    
     _showLinkPreviews = true;
     if (NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:webkitShowLinkPreviewsPreferenceKey])
         _showLinkPreviews = value.boolValue;
@@ -8812,7 +8814,7 @@ static RetainPtr<UITargetedPreview> createFallbackTargetedPreview(UIView *rootVi
 {
     id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
     
-    [_webView _didShowForcePressPreview];
+    [_webView _didShowContextMenu];
 
     NSURL *targetURL = controller.previewData[UIPreviewDataLink];
     URL coreTargetURL = targetURL;
@@ -8959,7 +8961,7 @@ static RetainPtr<UITargetedPreview> createFallbackTargetedPreview(UIView *rootVi
         [uiDelegate _webView:_webView didDismissPreviewViewController:viewController];
     ALLOW_DEPRECATED_DECLARATIONS_END
 
-    [_webView _didDismissForcePressPreview];
+    [_webView _didDismissContextMenu];
 }
 
 - (UIImage *)_presentationSnapshotForPreviewItemController:(UIPreviewItemController *)controller
@@ -8994,7 +8996,7 @@ static RetainPtr<UITargetedPreview> createFallbackTargetedPreview(UIView *rootVi
 {
     _longPressCanClick = NO;
     
-    [_webView _didDismissForcePressPreview];
+    [_webView _didDismissContextMenu];
 }
 
 @end
index 2c76a48..70327d9 100644 (file)
@@ -1,3 +1,40 @@
+2019-10-23  Megan Gardner  <megan_gardner@apple.com>
+
+        Rename force-press-related functions to refer to context menus, and fix a former force-press test
+        https://bugs.webkit.org/show_bug.cgi?id=202663
+        <rdar://problem/52699530>
+
+        Reviewed by Dean Jackson.
+
+        Rename all relevant fuctions to more correctly reflect that this does not specifically
+        require a force press to activate any longer.
+
+        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+        * TestRunnerShared/UIScriptContext/UIScriptContext.h:
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        (WTR::UIScriptController::setDidShowContextMenuCallback):
+        (WTR::UIScriptController::didShowContextMenuCallback const):
+        (WTR::UIScriptController::setDidDismissContextMenuCallback):
+        (WTR::UIScriptController::didDismissContextMenuCallback const):
+        (WTR::UIScriptController::setDidShowForcePressPreviewCallback): Deleted.
+        (WTR::UIScriptController::didShowForcePressPreviewCallback const): Deleted.
+        (WTR::UIScriptController::setDidDismissForcePressPreviewCallback): Deleted.
+        (WTR::UIScriptController::didDismissForcePressPreviewCallback const): Deleted.
+        * TestRunnerShared/UIScriptContext/UIScriptController.h:
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+        (-[TestRunnerWKWebView resetInteractionCallbacks]):
+        (-[TestRunnerWKWebView _didShowContextMenu]):
+        (-[TestRunnerWKWebView _didDismissContextMenu]):
+        (-[TestRunnerWKWebView _didShowForcePressPreview]): Deleted.
+        (-[TestRunnerWKWebView _didDismissForcePressPreview]): Deleted.
+        * WebKitTestRunner/ios/UIScriptControllerIOS.h:
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptControllerIOS::setDidShowContextMenuCallback):
+        (WTR::UIScriptControllerIOS::setDidDismissContextMenuCallback):
+        (WTR::UIScriptControllerIOS::setDidShowForcePressPreviewCallback): Deleted.
+        (WTR::UIScriptControllerIOS::setDidDismissForcePressPreviewCallback): Deleted.
+
 2019-10-23  Aakash Jain  <aakash_jain@apple.com>
 
         [EWS] Multiple builds are triggered for one patch sometimes in new EWS
index 8893f81..5520cc5 100644 (file)
@@ -203,9 +203,9 @@ interface UIScriptController {
     attribute object didStartFormControlInteractionCallback;
     attribute object didEndFormControlInteractionCallback;
 
-    // Force press preview handling
-    attribute object didShowForcePressPreviewCallback;
-    attribute object didDismissForcePressPreviewCallback;
+    // Pop Over preview handling
+    attribute object didShowContextMenuCallback;
+    attribute object didDismissContextMenuCallback;
 
     // <select> picker
     void selectFormAccessoryPickerRow(long rowIndex);
index 0b84d2d..a5b8061 100644 (file)
@@ -61,8 +61,8 @@ typedef enum  {
     CallbackTypeDidEndScrolling,
     CallbackTypeDidStartFormControlInteraction,
     CallbackTypeDidEndFormControlInteraction,
-    CallbackTypeDidShowForcePressPreview,
-    CallbackTypeDidDismissForcePressPreview,
+    CallbackTypeDidShowContextMenu,
+    CallbackTypeDidDismissContextMenu,
     CallbackTypeWillCreateNewPage,
     CallbackTypeNonPersistent = firstNonPersistentCallbackID
 } CallbackType;
index 800ccdb..96b6809 100644 (file)
@@ -105,24 +105,24 @@ JSValueRef UIScriptController::didEndFormControlInteractionCallback() const
     return m_context->callbackWithID(CallbackTypeDidEndFormControlInteraction);
 }
     
-void UIScriptController::setDidShowForcePressPreviewCallback(JSValueRef callback)
+void UIScriptController::setDidShowContextMenuCallback(JSValueRef callback)
 {
-    m_context->registerCallback(callback, CallbackTypeDidShowForcePressPreview);
+    m_context->registerCallback(callback, CallbackTypeDidShowContextMenu);
 }
 
-JSValueRef UIScriptController::didShowForcePressPreviewCallback() const
+JSValueRef UIScriptController::didShowContextMenuCallback() const
 {
-    return m_context->callbackWithID(CallbackTypeDidShowForcePressPreview);
+    return m_context->callbackWithID(CallbackTypeDidShowContextMenu);
 }
 
-void UIScriptController::setDidDismissForcePressPreviewCallback(JSValueRef callback)
+void UIScriptController::setDidDismissContextMenuCallback(JSValueRef callback)
 {
-    m_context->registerCallback(callback, CallbackTypeDidDismissForcePressPreview);
+    m_context->registerCallback(callback, CallbackTypeDidDismissContextMenu);
 }
 
-JSValueRef UIScriptController::didDismissForcePressPreviewCallback() const
+JSValueRef UIScriptController::didDismissContextMenuCallback() const
 {
-    return m_context->callbackWithID(CallbackTypeDidDismissForcePressPreview);
+    return m_context->callbackWithID(CallbackTypeDidDismissContextMenu);
 }
 
 void UIScriptController::setWillBeginZoomingCallback(JSValueRef callback)
index a08ff8e..3d032aa 100644 (file)
@@ -270,11 +270,11 @@ public:
     virtual void setDidEndFormControlInteractionCallback(JSValueRef);
     JSValueRef didEndFormControlInteractionCallback() const;
     
-    virtual void setDidShowForcePressPreviewCallback(JSValueRef);
-    JSValueRef didShowForcePressPreviewCallback() const;
+    virtual void setDidShowContextMenuCallback(JSValueRef);
+    JSValueRef didShowContextMenuCallback() const;
     
-    virtual void setDidDismissForcePressPreviewCallback(JSValueRef);
-    JSValueRef didDismissForcePressPreviewCallback() const;
+    virtual void setDidDismissContextMenuCallback(JSValueRef);
+    JSValueRef didDismissContextMenuCallback() const;
 
     virtual void setWillBeginZoomingCallback(JSValueRef);
     JSValueRef willBeginZoomingCallback() const;
index e0af99d..f04c963 100644 (file)
@@ -35,8 +35,8 @@
 
 @property (nonatomic, copy) void (^didStartFormControlInteractionCallback)(void);
 @property (nonatomic, copy) void (^didEndFormControlInteractionCallback)(void);
-@property (nonatomic, copy) void (^didShowForcePressPreviewCallback)(void);
-@property (nonatomic, copy) void (^didDismissForcePressPreviewCallback)(void);
+@property (nonatomic, copy) void (^didShowContextMenuCallback)(void);
+@property (nonatomic, copy) void (^didDismissContextMenuCallback)(void);
 @property (nonatomic, copy) void (^willBeginZoomingCallback)(void);
 @property (nonatomic, copy) void (^didEndZoomingCallback)(void);
 @property (nonatomic, copy) void (^didShowKeyboardCallback)(void);
index 52ced83..eca006c 100644 (file)
@@ -160,8 +160,8 @@ IGNORE_WARNINGS_END
 #if PLATFORM(IOS_FAMILY)
     self.didStartFormControlInteractionCallback = nil;
     self.didEndFormControlInteractionCallback = nil;
-    self.didShowForcePressPreviewCallback = nil;
-    self.didDismissForcePressPreviewCallback = nil;
+    self.didShowContextMenuCallback = nil;
+    self.didDismissContextMenuCallback = nil;
     self.willBeginZoomingCallback = nil;
     self.didEndZoomingCallback = nil;
     self.didShowKeyboardCallback = nil;
@@ -201,16 +201,16 @@ IGNORE_WARNINGS_END
     return _isInteractingWithFormControl;
 }
 
-- (void)_didShowForcePressPreview
+- (void)_didShowContextMenu
 {
-    if (self.didShowForcePressPreviewCallback)
-        self.didShowForcePressPreviewCallback();
+    if (self.didShowContextMenuCallback)
+        self.didShowContextMenuCallback();
 }
 
-- (void)_didDismissForcePressPreview
+- (void)_didDismissContextMenu
 {
-    if (self.didDismissForcePressPreviewCallback)
-        self.didDismissForcePressPreviewCallback();
+    if (self.didDismissContextMenuCallback)
+        self.didDismissContextMenuCallback();
 }
 
 - (BOOL)becomeFirstResponder
@@ -295,6 +295,7 @@ IGNORE_WARNINGS_END
     return canPerformActionByDefault;
 }
 
+
 - (void)zoomToScale:(double)scale animated:(BOOL)animated completionHandler:(void (^)(void))completionHandler
 {
     ASSERT(!self.zoomToScaleCompletionHandler);
index 3182c8d..1f397e4 100644 (file)
@@ -138,8 +138,8 @@ public:
 
     void setDidStartFormControlInteractionCallback(JSValueRef) override;
     void setDidEndFormControlInteractionCallback(JSValueRef) override;
-    void setDidShowForcePressPreviewCallback(JSValueRef) override;
-    void setDidDismissForcePressPreviewCallback(JSValueRef) override;
+    void setDidShowContextMenuCallback(JSValueRef) override;
+    void setDidDismissContextMenuCallback(JSValueRef) override;
     void setWillBeginZoomingCallback(JSValueRef) override;
     void setDidEndZoomingCallback(JSValueRef) override;
     void setDidShowKeyboardCallback(JSValueRef) override;
index 716fc69..90640b6 100644 (file)
@@ -873,20 +873,20 @@ void UIScriptControllerIOS::setDidEndFormControlInteractionCallback(JSValueRef c
     };
 }
     
-void UIScriptControllerIOS::setDidShowForcePressPreviewCallback(JSValueRef callback)
+void UIScriptControllerIOS::setDidShowContextMenuCallback(JSValueRef callback)
 {
-    UIScriptController::setDidShowForcePressPreviewCallback(callback);
-    webView().didShowForcePressPreviewCallback = ^ {
+    UIScriptController::setDidShowContextMenuCallback(callback);
+    webView().didShowContextMenuCallback = ^{
         if (!m_context)
             return;
-        m_context->fireCallback(CallbackTypeDidShowForcePressPreview);
+        m_context->fireCallback(CallbackTypeDidShowContextMenu);
     };
 }
 
-void UIScriptControllerIOS::setDidDismissForcePressPreviewCallback(JSValueRef callback)
+void UIScriptControllerIOS::setDidDismissContextMenuCallback(JSValueRef callback)
 {
-    UIScriptController::setDidDismissForcePressPreviewCallback(callback);
-    webView().didDismissForcePressPreviewCallback = ^ {
+    UIScriptController::setDidDismissContextMenuCallback(callback);
+    webView().didDismissContextMenuCallback = ^{
         if (!m_context)
             return;
         m_context->fireCallback(CallbackTypeDidEndFormControlInteraction);