Combine ActionMenuHitTestResult with WebHitTestResult
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Apr 2015 22:33:57 +0000 (22:33 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Apr 2015 22:33:57 +0000 (22:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143444

Reviewed by Beth Dakin.

* Shared/mac/ActionMenuHitTestResult.h: Removed.
* Shared/mac/ActionMenuHitTestResult.mm: Removed.

* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):
* Shared/WebHitTestResult.h:
* Shared/mac/WebHitTestResult.mm: Added.
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):

* UIProcess/API/mac/WKView.mm:
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformActionMenuHitTest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformActionMenuHitTest):
* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willDestroyView:]):
(-[WKActionMenuController _clearActionMenuState]):
(-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
(-[WKActionMenuController _hitTestResultDataImage]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
(-[WKActionMenuController _webHitTestResult]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _hitTestResultImage]): Deleted.
* UIProcess/mac/WKImmediateActionController.h:
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController willDestroyView:]):
(-[WKImmediateActionController _clearImmediateActionState]):
(-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
(-[WKImmediateActionController _webHitTestResult]):
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _updateImmediateActionItem]):
(-[WKImmediateActionController _menuItemForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForText]):
(-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

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

20 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebHitTestResult.cpp
Source/WebKit2/Shared/WebHitTestResult.h
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h [deleted file]
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm [deleted file]
Source/WebKit2/Shared/mac/WebHitTestResult.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.h
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.h
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 1bfe2e5..e816aba 100644 (file)
@@ -1,3 +1,67 @@
+2015-04-06  Brady Eidson  <beidson@apple.com>
+
+        Combine ActionMenuHitTestResult with WebHitTestResult
+        https://bugs.webkit.org/show_bug.cgi?id=143444
+
+        Reviewed by Beth Dakin.
+
+        * Shared/mac/ActionMenuHitTestResult.h: Removed.
+        * Shared/mac/ActionMenuHitTestResult.mm: Removed.
+
+        * Shared/WebHitTestResult.cpp:
+        (WebKit::WebHitTestResult::Data::Data):
+        (WebKit::WebHitTestResult::Data::encode):
+        (WebKit::WebHitTestResult::Data::decode):
+        (WebKit::WebHitTestResult::Data::platformEncode):
+        (WebKit::WebHitTestResult::Data::platformDecode):
+        * Shared/WebHitTestResult.h:
+        * Shared/mac/WebHitTestResult.mm: Added.
+        (WebKit::WebHitTestResult::Data::platformEncode):
+        (WebKit::WebHitTestResult::Data::platformDecode):
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
+        (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didPerformActionMenuHitTest):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::didPerformActionMenuHitTest):
+        * UIProcess/mac/WKActionMenuController.h:
+        * UIProcess/mac/WKActionMenuController.mm:
+        (-[WKActionMenuController willDestroyView:]):
+        (-[WKActionMenuController _clearActionMenuState]):
+        (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
+        (-[WKActionMenuController _hitTestResultDataImage]):
+        (-[WKActionMenuController _defaultMenuItemsForImage]):
+        (-[WKActionMenuController _copyImage:]):
+        (-[WKActionMenuController _addImageToPhotos:]):
+        (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
+        (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
+        (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
+        (-[WKActionMenuController _webHitTestResult]):
+        (-[WKActionMenuController _defaultMenuItems]):
+        (-[WKActionMenuController _hitTestResultImage]): Deleted.
+        * UIProcess/mac/WKImmediateActionController.h:
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController willDestroyView:]):
+        (-[WKImmediateActionController _clearImmediateActionState]):
+        (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
+        (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
+        (-[WKImmediateActionController _webHitTestResult]):
+        (-[WKImmediateActionController _defaultAnimationController]):
+        (-[WKImmediateActionController _updateImmediateActionItem]):
+        (-[WKImmediateActionController _menuItemForDataDetectedText]):
+        (-[WKImmediateActionController _animationControllerForText]):
+        (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performActionMenuHitTestAtLocation):
+
 2015-04-06  Jer Noble  <jer.noble@apple.com>
 
         Synchronize fullscreen animation between processes.
index 50d05ed..5fa4f6e 100644 (file)
@@ -58,6 +58,7 @@ WebHitTestResult::Data::Data(const HitTestResult& hitTestResult)
     , isOverTextInsideFormControlElement(hitTestResult.isOverTextInsideFormControlElement())
     , allowsCopy(hitTestResult.allowsCopy())
     , isDownloadableMedia(hitTestResult.isDownloadableMedia())
+    , imageSize(0)
 {
 }
 
@@ -81,6 +82,23 @@ void WebHitTestResult::Data::encode(IPC::ArgumentEncoder& encoder) const
     encoder << isOverTextInsideFormControlElement;
     encoder << allowsCopy;
     encoder << isDownloadableMedia;
+    encoder << hitTestLocationInViewCooordinates;
+    encoder << lookupText;
+    encoder << dictionaryPopupInfo;
+
+    SharedMemory::Handle imageHandle;
+    if (imageSharedMemory && imageSharedMemory->data())
+        imageSharedMemory->createHandle(imageHandle, SharedMemory::ReadOnly);
+    encoder << imageHandle;
+    encoder << imageSize;
+    encoder << imageExtension;
+
+    bool hasLinkTextIndicator = linkTextIndicator;
+    encoder << hasLinkTextIndicator;
+    if (hasLinkTextIndicator)
+        encoder << linkTextIndicator->data();
+
+    platformEncode(encoder);
 }
 
 bool WebHitTestResult::Data::decode(IPC::ArgumentDecoder& decoder, WebHitTestResult::Data& hitTestResultData)
@@ -98,11 +116,50 @@ bool WebHitTestResult::Data::decode(IPC::ArgumentDecoder& decoder, WebHitTestRes
         || !decoder.decode(hitTestResultData.isTextNode)
         || !decoder.decode(hitTestResultData.isOverTextInsideFormControlElement)
         || !decoder.decode(hitTestResultData.allowsCopy)
-        || !decoder.decode(hitTestResultData.isDownloadableMedia))
+        || !decoder.decode(hitTestResultData.isDownloadableMedia)
+        || !decoder.decode(hitTestResultData.hitTestLocationInViewCooordinates)
+        || !decoder.decode(hitTestResultData.lookupText)
+        || !decoder.decode(hitTestResultData.dictionaryPopupInfo))
         return false;
 
+    SharedMemory::Handle imageHandle;
+    if (!decoder.decode(imageHandle))
+        return false;
+
+    if (!imageHandle.isNull())
+        hitTestResultData.imageSharedMemory = SharedMemory::create(imageHandle, SharedMemory::ReadOnly);
+
+    if (!decoder.decode(hitTestResultData.imageSize))
+        return false;
+
+    if (!decoder.decode(hitTestResultData.imageExtension))
+        return false;
+
+    bool hasLinkTextIndicator;
+    if (!decoder.decode(hasLinkTextIndicator))
+        return false;
+
+    if (hasLinkTextIndicator) {
+        WebCore::TextIndicatorData indicatorData;
+        if (!decoder.decode(indicatorData))
+            return false;
+
+        hitTestResultData.linkTextIndicator = WebCore::TextIndicator::create(indicatorData);
+    }
+
+    return platformDecode(decoder, hitTestResultData);
+}
+
+#if !PLATFORM(MAC)
+void WebHitTestResult::Data::platformEncode(IPC::ArgumentEncoder& encoder) const
+{
+}
+
+bool WebHitTestResult::Data::platformDecode(IPC::ArgumentDecoder& decoder, WebHitTestResult::Data& hitTestResultData)
+{
     return true;
 }
+#endif // !PLATFORM(MAC)
 
 IntRect WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates(const HitTestResult& hitTestResult)
 {
index 863ed94..d857e3c 100644 (file)
 #define WebHitTestResult_h
 
 #include "APIObject.h"
+#include "DictionaryPopupInfo.h"
+#include "SharedMemory.h"
+#include <WebCore/FloatPoint.h>
 #include <WebCore/IntRect.h>
+#include <WebCore/PageOverlay.h>
 #include <wtf/Forward.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
+OBJC_CLASS DDActionContext;
+
 namespace IPC {
 class ArgumentDecoder;
 class ArgumentEncoder;
@@ -58,12 +64,32 @@ public:
         bool allowsCopy;
         bool isDownloadableMedia;
 
+        // FIXME: Added from ActionHitTestResult. All make sense?
+        WebCore::FloatPoint hitTestLocationInViewCooordinates;
+        String lookupText;
+        RefPtr<SharedMemory> imageSharedMemory;
+        uint64_t imageSize;
+        String imageExtension;
+
+#if PLATFORM(MAC)
+        RetainPtr<DDActionContext> detectedDataActionContext;
+#endif
+        WebCore::FloatRect detectedDataBoundingBox;
+        RefPtr<WebCore::TextIndicator> detectedDataTextIndicator;
+        WebCore::PageOverlay::PageOverlayID detectedDataOriginatingPageOverlay;
+
+        DictionaryPopupInfo dictionaryPopupInfo;
+
+        RefPtr<WebCore::TextIndicator> linkTextIndicator;
+
         Data();
         explicit Data(const WebCore::HitTestResult&);
         ~Data();
 
         void encode(IPC::ArgumentEncoder&) const;
+        void platformEncode(IPC::ArgumentEncoder&) const;
         static bool decode(IPC::ArgumentDecoder&, WebHitTestResult::Data&);
+        static bool platformDecode(IPC::ArgumentDecoder&, WebHitTestResult::Data&);
 
         WebCore::IntRect elementBoundingBoxInWindowCoordinates(const WebCore::HitTestResult&);
     };
diff --git a/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h b/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h
deleted file mode 100644 (file)
index fccab8b..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ActionMenuHitTestResult_h
-#define ActionMenuHitTestResult_h
-
-#include "DataReference.h"
-#include "DictionaryPopupInfo.h"
-#include "ShareableBitmap.h"
-#include "SharedMemory.h"
-#include "WebHitTestResult.h"
-#include <WebCore/FloatRect.h>
-#include <WebCore/PageOverlay.h>
-#include <WebCore/TextIndicator.h>
-#include <wtf/text/WTFString.h>
-
-OBJC_CLASS DDActionContext;
-
-namespace IPC {
-class ArgumentDecoder;
-class ArgumentEncoder;
-}
-
-namespace WebKit {
-
-struct ActionMenuHitTestResult {
-    void encode(IPC::ArgumentEncoder&) const;
-    static bool decode(IPC::ArgumentDecoder&, ActionMenuHitTestResult&);
-
-    WebCore::FloatPoint hitTestLocationInViewCooordinates;
-    WebHitTestResult::Data hitTestResult;
-
-    String lookupText;
-    RefPtr<SharedMemory> imageSharedMemory;
-    uint64_t imageSize;
-    String imageExtension;
-
-    RetainPtr<DDActionContext> actionContext;
-    WebCore::FloatRect detectedDataBoundingBox;
-    RefPtr<WebCore::TextIndicator> detectedDataTextIndicator;
-    WebCore::PageOverlay::PageOverlayID detectedDataOriginatingPageOverlay;
-
-    DictionaryPopupInfo dictionaryPopupInfo;
-
-    RefPtr<WebCore::TextIndicator> linkTextIndicator;
-
-    bool contentPreventsDefault;
-};
-
-} // namespace WebKit
-
-#endif // ActionMenuHitTestResult_h
diff --git a/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm b/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm
deleted file mode 100644 (file)
index 11a5954..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "ActionMenuHitTestResult.h"
-
-#if PLATFORM(MAC)
-
-#import "ArgumentCodersCF.h"
-#import "ArgumentDecoder.h"
-#import "ArgumentEncoder.h"
-#import "WebCoreArgumentCoders.h"
-#import <WebCore/DataDetectorsSPI.h>
-#import <WebCore/TextIndicator.h>
-
-namespace WebKit {
-
-void ActionMenuHitTestResult::encode(IPC::ArgumentEncoder& encoder) const
-{
-    encoder << hitTestLocationInViewCooordinates;
-    encoder << hitTestResult;
-    encoder << lookupText;
-    encoder << imageExtension;
-
-    SharedMemory::Handle imageHandle;
-    if (imageSharedMemory && imageSharedMemory->data())
-        imageSharedMemory->createHandle(imageHandle, SharedMemory::ReadOnly);
-    encoder << imageHandle;
-    encoder << imageSize;
-
-    bool hasActionContext = actionContext;
-    encoder << hasActionContext;
-    if (hasActionContext) {
-        RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]);
-        RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
-        [archiver setRequiresSecureCoding:YES];
-        [archiver encodeObject:actionContext.get() forKey:@"actionContext"];
-        [archiver finishEncoding];
-
-        IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
-
-        encoder << detectedDataBoundingBox;
-        encoder << detectedDataOriginatingPageOverlay;
-
-        bool hasDetectedDataTextIndicator = detectedDataTextIndicator;
-        encoder << hasDetectedDataTextIndicator;
-        if (hasDetectedDataTextIndicator)
-            encoder << detectedDataTextIndicator->data();
-    }
-
-    encoder << dictionaryPopupInfo;
-
-    bool hasLinkTextIndicator = linkTextIndicator;
-    encoder << hasLinkTextIndicator;
-    if (hasLinkTextIndicator)
-        encoder << linkTextIndicator->data();
-
-    encoder << contentPreventsDefault;
-}
-
-bool ActionMenuHitTestResult::decode(IPC::ArgumentDecoder& decoder, ActionMenuHitTestResult& actionMenuHitTestResult)
-{
-    if (!decoder.decode(actionMenuHitTestResult.hitTestLocationInViewCooordinates))
-        return false;
-
-    if (!decoder.decode(actionMenuHitTestResult.hitTestResult))
-        return false;
-
-    if (!decoder.decode(actionMenuHitTestResult.lookupText))
-        return false;
-
-    if (!decoder.decode(actionMenuHitTestResult.imageExtension))
-        return false;
-
-    SharedMemory::Handle imageHandle;
-    if (!decoder.decode(imageHandle))
-        return false;
-
-    if (!imageHandle.isNull())
-        actionMenuHitTestResult.imageSharedMemory = SharedMemory::create(imageHandle, SharedMemory::ReadOnly);
-
-    if (!decoder.decode(actionMenuHitTestResult.imageSize))
-        return false;
-
-    bool hasActionContext;
-    if (!decoder.decode(hasActionContext))
-        return false;
-
-    if (hasActionContext) {
-        RetainPtr<CFDataRef> data;
-        if (!IPC::decode(decoder, data))
-            return false;
-
-        RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
-        [unarchiver setRequiresSecureCoding:YES];
-        @try {
-            actionMenuHitTestResult.actionContext = [unarchiver decodeObjectOfClass:getDDActionContextClass() forKey:@"actionContext"];
-        } @catch (NSException *exception) {
-            LOG_ERROR("Failed to decode DDActionContext: %@", exception);
-            return false;
-        }
-        
-        [unarchiver finishDecoding];
-
-        if (!decoder.decode(actionMenuHitTestResult.detectedDataBoundingBox))
-            return false;
-
-        if (!decoder.decode(actionMenuHitTestResult.detectedDataOriginatingPageOverlay))
-            return false;
-
-        bool hasDetectedDataTextIndicator;
-        if (!decoder.decode(hasDetectedDataTextIndicator))
-            return false;
-
-        if (hasDetectedDataTextIndicator) {
-            WebCore::TextIndicatorData indicatorData;
-            if (!decoder.decode(indicatorData))
-                return false;
-
-            actionMenuHitTestResult.detectedDataTextIndicator = WebCore::TextIndicator::create(indicatorData);
-        }
-    }
-
-    if (!decoder.decode(actionMenuHitTestResult.dictionaryPopupInfo))
-        return false;
-
-    bool hasLinkTextIndicator;
-    if (!decoder.decode(hasLinkTextIndicator))
-        return false;
-
-    if (hasLinkTextIndicator) {
-        WebCore::TextIndicatorData indicatorData;
-        if (!decoder.decode(indicatorData))
-            return false;
-
-        actionMenuHitTestResult.linkTextIndicator = WebCore::TextIndicator::create(indicatorData);
-    }
-
-    if (!decoder.decode(actionMenuHitTestResult.contentPreventsDefault))
-        return false;
-
-    return true;
-}
-    
-} // namespace WebKit
-
-#endif // PLATFORM(MAC)
diff --git a/Source/WebKit2/Shared/mac/WebHitTestResult.mm b/Source/WebKit2/Shared/mac/WebHitTestResult.mm
new file mode 100644 (file)
index 0000000..3c149ef
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebHitTestResult.h"
+
+#if PLATFORM(MAC)
+
+#import "ArgumentCodersCF.h"
+#import "ArgumentDecoder.h"
+#import "ArgumentEncoder.h"
+#import "WebCoreArgumentCoders.h"
+#import <WebCore/DataDetectorsSPI.h>
+#import <WebCore/TextIndicator.h>
+
+namespace WebKit {
+
+void WebHitTestResult::Data::platformEncode(IPC::ArgumentEncoder& encoder) const
+{
+    bool hasActionContext = detectedDataActionContext;
+    encoder << hasActionContext;
+    if (!hasActionContext)
+        return;
+
+    RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]);
+    RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+    [archiver setRequiresSecureCoding:YES];
+    [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"];
+    [archiver finishEncoding];
+
+    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
+
+    encoder << detectedDataBoundingBox;
+    encoder << detectedDataOriginatingPageOverlay;
+
+    bool hasDetectedDataTextIndicator = detectedDataTextIndicator;
+    encoder << hasDetectedDataTextIndicator;
+    if (hasDetectedDataTextIndicator)
+        encoder << detectedDataTextIndicator->data();
+}
+
+bool WebHitTestResult::Data::platformDecode(IPC::ArgumentDecoder& decoder, WebHitTestResult::Data& hitTestResultData)
+{
+    bool hasActionContext;
+    if (!decoder.decode(hasActionContext))
+        return false;
+
+    if (!hasActionContext)
+        return true;
+
+    RetainPtr<CFDataRef> data;
+    if (!IPC::decode(decoder, data))
+        return false;
+
+    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
+    [unarchiver setRequiresSecureCoding:YES];
+    @try {
+        hitTestResultData.detectedDataActionContext = [unarchiver decodeObjectOfClass:getDDActionContextClass() forKey:@"actionContext"];
+    } @catch (NSException *exception) {
+        LOG_ERROR("Failed to decode DDActionContext: %@", exception);
+        return false;
+    }
+    
+    [unarchiver finishDecoding];
+
+    if (!decoder.decode(hitTestResultData.detectedDataBoundingBox))
+        return false;
+
+    if (!decoder.decode(hitTestResultData.detectedDataOriginatingPageOverlay))
+        return false;
+
+    bool hasDetectedDataTextIndicator;
+    if (!decoder.decode(hasDetectedDataTextIndicator))
+        return false;
+
+    if (hasDetectedDataTextIndicator) {
+        WebCore::TextIndicatorData indicatorData;
+        if (!decoder.decode(indicatorData))
+            return false;
+
+        hitTestResultData.detectedDataTextIndicator = WebCore::TextIndicator::create(indicatorData);
+    }
+
+    return true;
+}
+
+} // namespace WebKit
+
+#endif // PLATFORM(MAC)
index 4450ad4..bd25d56 100644 (file)
@@ -35,7 +35,6 @@
 
 #import "APILegacyContextHistoryClient.h"
 #import "APIPageConfiguration.h"
-#import "ActionMenuHitTestResult.h"
 #import "AttributedString.h"
 #import "ColorSpaceData.h"
 #import "DataReference.h"
@@ -68,6 +67,7 @@
 #import "WKViewPrivate.h"
 #import "WebBackForwardList.h"
 #import "WebEventFactory.h"
+#import "WebHitTestResult.h"
 #import "WebInspectorProxy.h"
 #import "WebKit2Initialize.h"
 #import "WebPage.h"
@@ -3931,10 +3931,10 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     [_data->_actionMenuController didCloseMenu:menu withEvent:event];
 }
 
-- (void)_didPerformActionMenuHitTest:(const ActionMenuHitTestResult&)hitTestResult forImmediateAction:(BOOL)forImmediateAction userData:(API::Object*)userData
+- (void)_didPerformActionMenuHitTest:(const WebHitTestResult::Data&)hitTestResult forImmediateAction:(BOOL)forImmediateAction contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData
 {
     if (forImmediateAction)
-        [_data->_immediateActionController didPerformActionMenuHitTest:hitTestResult userData:userData];
+        [_data->_immediateActionController didPerformActionMenuHitTest:hitTestResult contentPreventsDefault:contentPreventsDefault userData:userData];
     else
         [_data->_actionMenuController didPerformActionMenuHitTest:hitTestResult userData:userData];
 }
index c7a1ea8..e53d918 100644 (file)
@@ -29,6 +29,7 @@
 #import "PluginComplexTextInputState.h"
 #import "SameDocumentNavigationType.h"
 #import "WebFindOptions.h"
+#import "WebHitTestResult.h"
 #import <wtf/Forward.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
@@ -55,7 +56,6 @@ class DrawingAreaProxy;
 class LayerTreeContext;
 class ViewSnapshot;
 class WebProcessPool;
-struct ActionMenuHitTestResult;
 struct ColorSpaceData;
 struct EditorState;
 struct WebPageConfiguration;
@@ -140,7 +140,7 @@ struct WebPageConfiguration;
 - (void)_closeFullScreenWindowController;
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
-- (void)_didPerformActionMenuHitTest:(const WebKit::ActionMenuHitTestResult&)hitTestResult forImmediateAction:(BOOL)forImmediateAction userData:(API::Object*)userData;
+- (void)_didPerformActionMenuHitTest:(const WebKit::WebHitTestResult::Data&)hitTestResult forImmediateAction:(BOOL)forImmediateAction contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
 #endif
 
 @property (nonatomic, retain, setter=_setPrimaryTrackingArea:) NSTrackingArea *_primaryTrackingArea;
index 8606816..e758f67 100644 (file)
@@ -65,7 +65,6 @@ class ViewSnapshot;
 class WebContextMenuProxy;
 class WebEditCommandProxy;
 class WebPopupMenuProxy;
-struct ActionMenuHitTestResult;
 
 #if ENABLE(TOUCH_EVENTS)
 class NativeWebTouchEvent;
@@ -322,7 +321,7 @@ public:
     virtual void didChangeBackgroundColor() = 0;
 
 #if PLATFORM(MAC)
-    virtual void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, API::Object*) = 0;
+    virtual void didPerformActionMenuHitTest(const WebHitTestResult::Data&, bool forImmediateAction, bool contentPreventsDefault, API::Object*) = 0;
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
index 352209c..27551aa 100644 (file)
@@ -5645,9 +5645,9 @@ void WebPageProxy::immediateActionDidComplete()
     m_process->send(Messages::WebPage::ImmediateActionDidComplete(), m_pageID);
 }
 
-void WebPageProxy::didPerformActionMenuHitTest(const ActionMenuHitTestResult& result, bool forImmediateAction, const UserData& userData)
+void WebPageProxy::didPerformActionMenuHitTest(const WebHitTestResult::Data& result, bool forImmediateAction, bool contentPreventsDefault, const UserData& userData)
 {
-    m_pageClient.didPerformActionMenuHitTest(result, forImmediateAction, m_process->transformHandlesToObjects(userData.object()).get());
+    m_pageClient.didPerformActionMenuHitTest(result, forImmediateAction, contentPreventsDefault, m_process->transformHandlesToObjects(userData.object()).get());
 }
 
 void WebPageProxy::installViewStateChangeCompletionHandler(void (^completionHandler)())
index 9630e1d..7d11021 100644 (file)
@@ -190,7 +190,6 @@ class WebProcessProxy;
 class WebUserContentControllerProxy;
 class WebWheelEvent;
 class WebsiteDataStore;
-struct ActionMenuHitTestResult;
 struct AttributedString;
 struct ColorSpaceData;
 struct DictionaryPopupInfo;
@@ -1413,7 +1412,7 @@ private:
     void viewDidEnterWindow();
 
 #if PLATFORM(MAC)
-    void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, const UserData&);
+    void didPerformActionMenuHitTest(const WebHitTestResult::Data&, bool forImmediateAction, bool contentPreventsDefault, const UserData&);
 #endif
 
     void handleAutoFillButtonClick(const UserData&);
index 7d32713..6114308 100644 (file)
@@ -424,7 +424,7 @@ messages -> WebPageProxy {
     IsPlayingAudioDidChange(bool newIsPlayingAudio)
 
 #if PLATFORM(MAC)
-    DidPerformActionMenuHitTest(struct WebKit::ActionMenuHitTestResult result, bool forImmediateAction, WebKit::UserData userData)
+    DidPerformActionMenuHitTest(struct WebKit::WebHitTestResult::Data result, bool forImmediateAction, bool contentPreventsDefault, WebKit::UserData userData)
 #endif
     HandleMessage(String messageName, WebKit::UserData messageBody) WantsConnection
     HandleSynchronousMessage(String messageName, WebKit::UserData messageBody) -> (WebKit::UserData returnData) WantsConnection
index 632b56d..8eef93a 100644 (file)
@@ -195,7 +195,7 @@ private:
     virtual void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override;
     virtual void removeNavigationGestureSnapshot() override;
 
-    virtual void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, API::Object*) override;
+    virtual void didPerformActionMenuHitTest(const WebHitTestResult::Data&, bool forImmediateAction, bool contentPreventsDefault, API::Object*) override;
     virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) override;
 
     virtual void didChangeBackgroundColor() override;
index e11b3bc..679939f 100644 (file)
@@ -792,10 +792,10 @@ CGRect PageClientImpl::boundsOfLayerInLayerBackedWindowCoordinates(CALayer *laye
     return [windowContentLayer convertRect:layer.bounds fromLayer:layer];
 }
 
-void PageClientImpl::didPerformActionMenuHitTest(const ActionMenuHitTestResult& result, bool forImmediateAction, API::Object* userData)
+void PageClientImpl::didPerformActionMenuHitTest(const WebHitTestResult::Data& result, bool forImmediateAction, bool contentPreventsDefault, API::Object* userData)
 {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
-    [m_wkView _didPerformActionMenuHitTest:result forImmediateAction:forImmediateAction userData:userData];
+    [m_wkView _didPerformActionMenuHitTest:result forImmediateAction:forImmediateAction contentPreventsDefault:contentPreventsDefault userData:userData];
 #endif
 }
 
index 67dac7b..a69b28f 100644 (file)
@@ -28,9 +28,9 @@
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
 
-#import "ActionMenuHitTestResult.h"
 #import "WKActionMenuItemTypes.h"
 #import "WKActionMenuTypes.h"
+#import "WebHitTestResult.h"
 #import <AppKit/NSSharingService.h>
 #import <wtf/RetainPtr.h>
 
@@ -54,7 +54,7 @@ enum class ActionMenuState {
     WKView *_wkView;
 
     WebKit::ActionMenuState _state;
-    WebKit::ActionMenuHitTestResult _hitTestResult;
+    WebKit::WebHitTestResult::Data _hitTestResultData;
     RefPtr<API::Object> _userData;
     _WKActionMenuType _type;
     RetainPtr<NSSharingServicePicker> _sharingServicePicker;
@@ -72,7 +72,7 @@ enum class ActionMenuState {
 - (void)didCloseMenu:(NSMenu *)menu withEvent:(NSEvent *)event;
 - (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event;
 
-- (void)didPerformActionMenuHitTest:(const WebKit::ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData;
+- (void)didPerformActionMenuHitTest:(const WebKit::WebHitTestResult::Data&)hitTestResult userData:(API::Object*)userData;
 
 @end
 
index fd7ec5a..3a0b867 100644 (file)
@@ -85,7 +85,7 @@ using namespace WebKit;
 {
     _page = nullptr;
     _wkView = nil;
-    _hitTestResult = ActionMenuHitTestResult();
+    _hitTestResultData = WebHitTestResult::Data();
     _currentActionContext = nil;
 }
 
@@ -161,18 +161,18 @@ using namespace WebKit;
     }
 
     _state = ActionMenuState::None;
-    _hitTestResult = ActionMenuHitTestResult();
+    _hitTestResultData = WebHitTestResult::Data();
     _type = kWKActionMenuNone;
     _sharingServicePicker = nil;
     _currentActionContext = nil;
     _userData = nil;
 }
 
-- (void)didPerformActionMenuHitTest:(const ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData
+- (void)didPerformActionMenuHitTest:(const WebHitTestResult::Data&)hitTestResult userData:(API::Object*)userData
 {
     // FIXME: This needs to use the WebKit2 callback mechanism to avoid out-of-order replies.
     _state = ActionMenuState::Ready;
-    _hitTestResult = hitTestResult;
+    _hitTestResultData = hitTestResult;
     _userData = userData;
 
     [self _updateActionMenuItems];
@@ -239,13 +239,13 @@ using namespace WebKit;
 
 #pragma mark Image actions
 
-- (NSImage *)_hitTestResultImage
+- (NSImage *)_hitTestResultDataImage
 {
-    RefPtr<SharedMemory> imageSharedMemory = _hitTestResult.imageSharedMemory;
+    RefPtr<SharedMemory> imageSharedMemory = _hitTestResultData.imageSharedMemory;
     if (!imageSharedMemory)
         return nil;
 
-    RetainPtr<NSImage> nsImage = adoptNS([[NSImage alloc] initWithData:[NSData dataWithBytes:imageSharedMemory->data() length:_hitTestResult.imageSize]]);
+    RetainPtr<NSImage> nsImage = adoptNS([[NSImage alloc] initWithData:[NSData dataWithBytes:imageSharedMemory->data() length:_hitTestResultData.imageSize]]);
     return nsImage.autorelease();
 }
 
@@ -258,14 +258,14 @@ using namespace WebKit;
     else
         addToPhotosItem = [NSMenuItem separatorItem];
     RetainPtr<NSMenuItem> saveToDownloadsItem = [self _createActionMenuItemForTag:kWKContextActionItemTagSaveImageToDownloads];
-    RetainPtr<NSMenuItem> shareItem = [self _createShareActionMenuItemForTag:kWKContextActionItemTagShareImage withItems:@[ [self _hitTestResultImage] ]];
+    RetainPtr<NSMenuItem> shareItem = [self _createShareActionMenuItemForTag:kWKContextActionItemTagShareImage withItems:@[ [self _hitTestResultDataImage] ]];
 
     return @[ copyImageItem.get(), addToPhotosItem.get(), saveToDownloadsItem.get(), shareItem.get() ];
 }
 
 - (void)_copyImage:(id)sender
 {
-    RetainPtr<NSImage> image = [self _hitTestResultImage];
+    RetainPtr<NSImage> image = [self _hitTestResultDataImage];
     if (!image)
         return;
 
@@ -334,12 +334,12 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
     if (![self _canAddMediaToPhotos])
         return;
 
-    RefPtr<SharedMemory> imageSharedMemory = _hitTestResult.imageSharedMemory;
-    if (!imageSharedMemory->data() || _hitTestResult.imageExtension.isEmpty() || !_hitTestResult.imageSize)
+    RefPtr<SharedMemory> imageSharedMemory = _hitTestResultData.imageSharedMemory;
+    if (!imageSharedMemory->data() || _hitTestResultData.imageExtension.isEmpty() || !_hitTestResultData.imageSize)
         return;
 
-    RetainPtr<NSData> imageData = adoptNS([[NSData alloc] initWithBytes:imageSharedMemory->data() length:_hitTestResult.imageSize]);
-    RetainPtr<NSString> suggestedFilename = [[[NSProcessInfo processInfo] globallyUniqueString] stringByAppendingPathExtension:_hitTestResult.imageExtension];
+    RetainPtr<NSData> imageData = adoptNS([[NSData alloc] initWithBytes:imageSharedMemory->data() length:_hitTestResultData.imageSize]);
+    RetainPtr<NSString> suggestedFilename = [[[NSProcessInfo processInfo] globallyUniqueString] stringByAppendingPathExtension:_hitTestResultData.imageExtension];
 
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         NSString *filePath = pathToPhotoOnDisk(suggestedFilename.get());
@@ -360,7 +360,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
 - (NSArray *)_defaultMenuItemsForDataDetectedText
 {
-    DDActionContext *actionContext = _hitTestResult.actionContext.get();
+    DDActionContext *actionContext = _hitTestResultData.detectedDataActionContext.get();
     if (!actionContext)
         return @[ ];
 
@@ -372,19 +372,19 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
     // Ref our WebPageProxy for use in the blocks below.
     RefPtr<WebPageProxy> page = _page;
-    PageOverlay::PageOverlayID overlayID = _hitTestResult.detectedDataOriginatingPageOverlay;
+    PageOverlay::PageOverlayID overlayID = _hitTestResultData.detectedDataOriginatingPageOverlay;
     _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
         page->send(Messages::WebPage::DataDetectorsDidPresentUI(overlayID));
     } interactionChangedHandler:^() {
-        if (_hitTestResult.detectedDataTextIndicator)
-            page->setTextIndicator(_hitTestResult.detectedDataTextIndicator->data(), false);
+        if (_hitTestResultData.detectedDataTextIndicator)
+            page->setTextIndicator(_hitTestResultData.detectedDataTextIndicator->data(), false);
         page->send(Messages::WebPage::DataDetectorsDidChangeUI(overlayID));
     } interactionStoppedHandler:^() {
         page->send(Messages::WebPage::DataDetectorsDidHideUI(overlayID));
         page->clearTextIndicator();
     }];
 
-    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]]];
+    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResultData.detectedDataBoundingBox toView:nil]]];
 
     NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
     return menuItems;
@@ -409,16 +409,16 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
 - (NSArray *)_defaultMenuItemsForEditableTextWithSuggestions
 {
-    if (_hitTestResult.lookupText.isEmpty())
+    if (_hitTestResultData.lookupText.isEmpty())
         return @[ ];
 
     Vector<TextCheckingResult> results;
-    _page->checkTextOfParagraph(_hitTestResult.lookupText, NSTextCheckingTypeSpelling, results);
+    _page->checkTextOfParagraph(_hitTestResultData.lookupText, NSTextCheckingTypeSpelling, results);
     if (results.isEmpty())
         return @[ ];
 
     Vector<String> guesses;
-    _page->getGuessesForWord(_hitTestResult.lookupText, String(), guesses);
+    _page->getGuessesForWord(_hitTestResultData.lookupText, String(), guesses);
     if (guesses.isEmpty())
         return @[ ];
 
@@ -484,7 +484,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
     } interactionStoppedHandler:^() {
     }];
 
-    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]]];
+    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResultData.detectedDataBoundingBox toView:nil]]];
 
     return [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:hitTestResult->absoluteLinkURL() actionContext:_currentActionContext.get()];
 }
@@ -650,7 +650,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 {
     RefPtr<WebHitTestResult> hitTestResult;
     if (_state == ActionMenuState::Ready)
-        hitTestResult = WebHitTestResult::create(_hitTestResult.hitTestResult);
+        hitTestResult = WebHitTestResult::create(_hitTestResultData);
     else
         hitTestResult = _page->lastMouseMoveHitTestResult();
 
@@ -688,7 +688,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
         return [self _defaultMenuItemsForVideo];
     }
 
-    if (!hitTestResult->absoluteImageURL().isEmpty() && _hitTestResult.imageSharedMemory && !_hitTestResult.imageExtension.isEmpty()) {
+    if (!hitTestResult->absoluteImageURL().isEmpty() && _hitTestResultData.imageSharedMemory && !_hitTestResultData.imageExtension.isEmpty()) {
         _type = kWKActionMenuImage;
         return [self _defaultMenuItemsForImage];
     }
index cda71de..255e3dc 100644 (file)
@@ -28,8 +28,8 @@
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
 
-#import "ActionMenuHitTestResult.h"
 #import "WKImmediateActionTypes.h"
+#import "WebHitTestResult.h"
 #import <WebCore/NSImmediateActionGestureRecognizerSPI.h>
 #import <wtf/RetainPtr.h>
 
@@ -54,7 +54,8 @@ enum class ImmediateActionState {
     WKView *_wkView;
 
     WebKit::ImmediateActionState _state;
-    WebKit::ActionMenuHitTestResult _hitTestResult;
+    WebKit::WebHitTestResult::Data _hitTestResultData;
+    BOOL _contentPreventsDefault;
     RefPtr<API::Object> _userData;
     _WKImmediateActionType _type;
     RetainPtr<NSImmediateActionGestureRecognizer> _immediateActionRecognizer;
@@ -68,7 +69,7 @@ enum class ImmediateActionState {
 
 - (instancetype)initWithPage:(WebKit::WebPageProxy&)page view:(WKView *)wkView recognizer:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer;
 - (void)willDestroyView:(WKView *)view;
-- (void)didPerformActionMenuHitTest:(const WebKit::ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData;
+- (void)didPerformActionMenuHitTest:(const WebKit::WebHitTestResult::Data&)hitTestResult contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
 - (void)dismissContentRelativeChildWindows;
 - (BOOL)hasActiveImmediateAction;
 
index 4e0c4b6..c4c8bea 100644 (file)
@@ -82,8 +82,9 @@ using namespace WebKit;
 {
     _page = nullptr;
     _wkView = nil;
-    _hitTestResult = ActionMenuHitTestResult();
-
+    _hitTestResultData = WebHitTestResult::Data();
+    _contentPreventsDefault = NO;
+    
     id animationController = [_immediateActionRecognizer animationController];
     if ([animationController isKindOfClass:NSClassFromString(@"QLPreviewMenuItem")]) {
         QLPreviewMenuItem *menuItem = (QLPreviewMenuItem *)animationController;
@@ -121,7 +122,8 @@ using namespace WebKit;
     }
 
     _state = ImmediateActionState::None;
-    _hitTestResult = ActionMenuHitTestResult();
+    _hitTestResultData = WebHitTestResult::Data();
+    _contentPreventsDefault = NO;
     _type = kWKImmediateActionNone;
     _currentActionContext = nil;
     _userData = nil;
@@ -129,7 +131,7 @@ using namespace WebKit;
     _hasActiveImmediateAction = NO;
 }
 
-- (void)didPerformActionMenuHitTest:(const ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData
+- (void)didPerformActionMenuHitTest:(const WebHitTestResult::Data&)hitTestResult contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData
 {
     // If we've already given up on this gesture (either because it was canceled or the
     // willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
@@ -138,7 +140,8 @@ using namespace WebKit;
 
     // FIXME: This needs to use the WebKit2 callback mechanism to avoid out-of-order replies.
     _state = ImmediateActionState::Ready;
-    _hitTestResult = hitTestResult;
+    _hitTestResultData = hitTestResult;
+    _contentPreventsDefault = contentPreventsDefault;
     _userData = userData;
 
     [self _updateImmediateActionItem];
@@ -213,7 +216,7 @@ using namespace WebKit;
         return;
 
     _page->immediateActionDidUpdate();
-    if (_hitTestResult.contentPreventsDefault)
+    if (_contentPreventsDefault)
         return;
 
     _page->setTextIndicatorAnimationProgress([immediateActionRecognizer animationProgress]);
@@ -249,7 +252,7 @@ using namespace WebKit;
 {
     RefPtr<WebHitTestResult> hitTestResult;
     if (_state == ImmediateActionState::Ready)
-        hitTestResult = WebHitTestResult::create(_hitTestResult.hitTestResult);
+        hitTestResult = WebHitTestResult::create(_hitTestResultData);
     else
         hitTestResult = _page->lastMouseMoveHitTestResult();
 
@@ -260,7 +263,7 @@ using namespace WebKit;
 
 - (id <NSImmediateActionAnimationController>)_defaultAnimationController
 {
-    if (_hitTestResult.contentPreventsDefault) {
+    if (_contentPreventsDefault) {
         RetainPtr<WebAnimationController> dummyController = [[WebAnimationController alloc] init];
         return dummyController.get();
     }
@@ -274,7 +277,7 @@ using namespace WebKit;
     if (!absoluteLinkURL.isEmpty() && WebCore::protocolIsInHTTPFamily(absoluteLinkURL)) {
         _type = kWKImmediateActionLinkPreview;
 
-        if (TextIndicator *textIndicator = _hitTestResult.linkTextIndicator.get())
+        if (TextIndicator *textIndicator = _hitTestResultData.linkTextIndicator.get())
             _page->setTextIndicator(textIndicator->data(), false);
 
         RetainPtr<QLPreviewMenuItem> qlPreviewLinkItem = [NSMenuItem standardQuickLookMenuItem];
@@ -305,7 +308,7 @@ using namespace WebKit;
 
     id <NSImmediateActionAnimationController> defaultAnimationController = [self _defaultAnimationController];
 
-    if (_hitTestResult.contentPreventsDefault) {
+    if (_contentPreventsDefault) {
         [_immediateActionRecognizer.get() setAnimationController:defaultAnimationController];
         return;
     }
@@ -373,7 +376,7 @@ using namespace WebKit;
 
 - (NSMenuItem *)_menuItemForDataDetectedText
 {
-    DDActionContext *actionContext = _hitTestResult.actionContext.get();
+    DDActionContext *actionContext = _hitTestResultData.detectedDataActionContext.get();
     if (!actionContext)
         return nil;
 
@@ -385,19 +388,19 @@ using namespace WebKit;
     }
 
     RefPtr<WebPageProxy> page = _page;
-    PageOverlay::PageOverlayID overlayID = _hitTestResult.detectedDataOriginatingPageOverlay;
+    PageOverlay::PageOverlayID overlayID = _hitTestResultData.detectedDataOriginatingPageOverlay;
     _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
         page->send(Messages::WebPage::DataDetectorsDidPresentUI(overlayID));
     } interactionChangedHandler:^() {
-        if (_hitTestResult.detectedDataTextIndicator)
-            page->setTextIndicator(_hitTestResult.detectedDataTextIndicator->data(), false);
+        if (_hitTestResultData.detectedDataTextIndicator)
+            page->setTextIndicator(_hitTestResultData.detectedDataTextIndicator->data(), false);
         page->send(Messages::WebPage::DataDetectorsDidChangeUI(overlayID));
     } interactionStoppedHandler:^() {
         page->send(Messages::WebPage::DataDetectorsDidHideUI(overlayID));
         [self _clearImmediateActionState];
     }];
 
-    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]]];
+    [_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResultData.detectedDataBoundingBox toView:nil]]];
 
     NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
 
@@ -417,7 +420,7 @@ using namespace WebKit;
     if (!getLULookupDefinitionModuleClass())
         return nil;
 
-    DictionaryPopupInfo dictionaryPopupInfo = _hitTestResult.dictionaryPopupInfo;
+    DictionaryPopupInfo dictionaryPopupInfo = _hitTestResultData.dictionaryPopupInfo;
     if (!dictionaryPopupInfo.attributedString.string)
         return nil;
 
index 9d24af6..6d8266a 100644 (file)
                2D2ADF0916362DD500197E47 /* PDFPluginTextAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF0616362DC700197E47 /* PDFPluginTextAnnotation.mm */; };
                2D2ADF0B16362DDB00197E47 /* PDFPluginAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF031636243500197E47 /* PDFPluginAnnotation.mm */; };
                2D2ADF1016364D8200197E47 /* PDFPluginChoiceAnnotation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2ADF0E16364D8200197E47 /* PDFPluginChoiceAnnotation.mm */; };
-               2D353B1219F8305D000EEACD /* ActionMenuHitTestResult.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D353B1019F8305D000EEACD /* ActionMenuHitTestResult.mm */; };
-               2D353B1319F8305D000EEACD /* ActionMenuHitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D353B1119F8305D000EEACD /* ActionMenuHitTestResult.h */; };
                2D3A65DA1A7C3A1F00CAC637 /* WKNavigationActionRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D3A65D81A7C3A1F00CAC637 /* WKNavigationActionRef.cpp */; };
                2D3A65DB1A7C3A1F00CAC637 /* WKNavigationActionRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D3A65D91A7C3A1F00CAC637 /* WKNavigationActionRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2D3A65DE1A7C3A7D00CAC637 /* WKNavigationResponseRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D3A65DC1A7C3A7D00CAC637 /* WKNavigationResponseRef.cpp */; };
                51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBB81127A8BAD00D203B9 /* WebContextMenuProxy.h */; };
                51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */; };
                51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; };
+               51AD35731AD2F3940057B38E /* WebHitTestResult.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51AD35721AD2F3750057B38E /* WebHitTestResult.mm */; };
                51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; };
                51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
                51BA24441858EE3000EA2811 /* AsyncTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BA24431858EE3000EA2811 /* AsyncTask.h */; };
                2D2ADF0C16363DEC00197E47 /* PDFLayerControllerDetails.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PDFLayerControllerDetails.h; path = PDF/PDFLayerControllerDetails.h; sourceTree = "<group>"; };
                2D2ADF0D16364D8200197E47 /* PDFPluginChoiceAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFPluginChoiceAnnotation.h; path = PDF/PDFPluginChoiceAnnotation.h; sourceTree = "<group>"; };
                2D2ADF0E16364D8200197E47 /* PDFPluginChoiceAnnotation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPluginChoiceAnnotation.mm; path = PDF/PDFPluginChoiceAnnotation.mm; sourceTree = "<group>"; };
-               2D353B1019F8305D000EEACD /* ActionMenuHitTestResult.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ActionMenuHitTestResult.mm; sourceTree = "<group>"; };
-               2D353B1119F8305D000EEACD /* ActionMenuHitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionMenuHitTestResult.h; sourceTree = "<group>"; };
                2D3A65D81A7C3A1F00CAC637 /* WKNavigationActionRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationActionRef.cpp; sourceTree = "<group>"; };
                2D3A65D91A7C3A1F00CAC637 /* WKNavigationActionRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationActionRef.h; sourceTree = "<group>"; };
                2D3A65DC1A7C3A7D00CAC637 /* WKNavigationResponseRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationResponseRef.cpp; sourceTree = "<group>"; };
                51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuProxyMac.mm; sourceTree = "<group>"; };
                51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkProcessMessageReceiver.cpp; sourceTree = "<group>"; };
                51ACC9351628064800342550 /* NetworkProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessMessages.h; sourceTree = "<group>"; };
+               51AD35721AD2F3750057B38E /* WebHitTestResult.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHitTestResult.mm; sourceTree = "<group>"; };
                51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = "<group>"; };
                51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; };
                51BA24431858EE3000EA2811 /* AsyncTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncTask.h; sourceTree = "<group>"; };
                BC111B5A112F628200337BAB /* mac */ = {
                        isa = PBXGroup;
                        children = (
-                               2D353B1119F8305D000EEACD /* ActionMenuHitTestResult.h */,
-                               2D353B1019F8305D000EEACD /* ActionMenuHitTestResult.mm */,
                                E179FD9B134D38060015B883 /* ArgumentCodersMac.h */,
                                E179FD9E134D38250015B883 /* ArgumentCodersMac.mm */,
                                E1A31731134CEA6C007C9A4F /* AttributedString.h */,
                                BCE23262122C6CF300D5C35A /* WebCoreArgumentCodersMac.mm */,
                                BC111B5B112F629800337BAB /* WebEventFactory.h */,
                                BC111B5C112F629800337BAB /* WebEventFactory.mm */,
+                               51AD35721AD2F3750057B38E /* WebHitTestResult.mm */,
                                905620E512BC2476000799B6 /* WebMemorySampler.mac.mm */,
                        );
                        path = mac;
                                75A8D2C8187CCFAB00C39C9E /* _WKWebsiteDataStore.h in Headers */,
                                75A8D2D6187D1C0E00C39C9E /* _WKWebsiteDataStoreInternal.h in Headers */,
                                A115DC72191D82DA00DA8072 /* _WKWebViewPrintFormatter.h in Headers */,
-                               2D353B1319F8305D000EEACD /* ActionMenuHitTestResult.h in Headers */,
                                A7D792D81767CCA300881CBE /* ActivityAssertion.h in Headers */,
                                BC64697011DBE603006455B0 /* APIArray.h in Headers */,
                                1A3DD206125E5A2F004515E6 /* APIClient.h in Headers */,
                                1A81B38018BD66AD0007FDAC /* _WKVisitedLinkProvider.mm in Sources */,
                                75A8D2C9187CCFAF00C39C9E /* _WKWebsiteDataStore.mm in Sources */,
                                A115DC71191D82D700DA8072 /* _WKWebViewPrintFormatter.mm in Sources */,
-                               2D353B1219F8305D000EEACD /* ActionMenuHitTestResult.mm in Sources */,
                                A7D792D61767CB6E00881CBE /* ActivityAssertion.cpp in Sources */,
                                8372DB281A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp in Sources */,
                                BC64696F11DBE603006455B0 /* APIArray.cpp in Sources */,
                                31A505F91680025500A930EB /* WebContextClient.cpp in Sources */,
                                BC09B8F8147460F7005F5625 /* WebContextConnectionClient.cpp in Sources */,
                                BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */,
+                               51AD35731AD2F3940057B38E /* WebHitTestResult.mm in Sources */,
                                51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */,
                                BC111A5B112F4FBB00337BAB /* WebContextMenuClient.cpp in Sources */,
                                51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */,
index 5891d7f..08bb62f 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(MAC)
 
-#import "ActionMenuHitTestResult.h"
 #import "AttributedString.h"
 #import "DataReference.h"
 #import "DictionaryPopupInfo.h"
@@ -45,6 +44,7 @@
 #import "WebEvent.h"
 #import "WebEventConversion.h"
 #import "WebFrame.h"
+#import "WebHitTestResult.h"
 #import "WebImage.h"
 #import "WebInspector.h"
 #import "WebPageOverlay.h"
@@ -1017,7 +1017,7 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
 
     MainFrame& mainFrame = corePage()->mainFrame();
     if (!mainFrame.view() || !mainFrame.view()->renderView()) {
-        send(Messages::WebPageProxy::DidPerformActionMenuHitTest(ActionMenuHitTestResult(), forImmediateAction, UserData()));
+        send(Messages::WebPageProxy::DidPerformActionMenuHitTest(WebHitTestResult::Data(), forImmediateAction, false, UserData()));
         return;
     }
 
@@ -1033,10 +1033,8 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
             m_lastActionMenuHitTestPreventsDefault = element->dispatchMouseForceWillBegin();
     }
 
-    ActionMenuHitTestResult actionMenuResult;
+    WebHitTestResult::Data actionMenuResult(hitTestResult);
     actionMenuResult.hitTestLocationInViewCooordinates = locationInViewCooordinates;
-    actionMenuResult.hitTestResult = WebHitTestResult::Data(hitTestResult);
-    actionMenuResult.contentPreventsDefault = m_lastActionMenuHitTestPreventsDefault;
 
     RefPtr<Range> selectionRange = corePage()->focusController().focusedOrMainFrame().selection().selection().firstRange();
 
@@ -1086,7 +1084,7 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
             continue;
 
         pageOverlayDidOverrideDataDetectors = true;
-        actionMenuResult.actionContext = actionContext;
+        actionMenuResult.detectedDataActionContext = actionContext;
 
         Vector<FloatQuad> quads;
         mainResultRange->textQuads(quads);
@@ -1107,8 +1105,8 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
     if (!pageOverlayDidOverrideDataDetectors && hitTestResult.innerNode() && hitTestResult.innerNode()->isTextNode()) {
         FloatRect detectedDataBoundingBox;
         RefPtr<Range> detectedDataRange;
-        actionMenuResult.actionContext = DataDetection::detectItemAroundHitTestResult(hitTestResult, detectedDataBoundingBox, detectedDataRange);
-        if (actionMenuResult.actionContext && detectedDataRange) {
+        actionMenuResult.detectedDataActionContext = DataDetection::detectItemAroundHitTestResult(hitTestResult, detectedDataBoundingBox, detectedDataRange);
+        if (actionMenuResult.detectedDataActionContext && detectedDataRange) {
             actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
             actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, textIndicatorTransitionForActionMenu(selectionRange.get(), *detectedDataRange, forImmediateAction, true));
             m_lastActionMenuRangeForSelection = detectedDataRange;
@@ -1118,7 +1116,7 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
     RefPtr<API::Object> userData;
     injectedBundleContextMenuClient().prepareForActionMenu(*this, hitTestResult, userData);
 
-    send(Messages::WebPageProxy::DidPerformActionMenuHitTest(actionMenuResult, forImmediateAction, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    send(Messages::WebPageProxy::DidPerformActionMenuHitTest(actionMenuResult, forImmediateAction, m_lastActionMenuHitTestPreventsDefault, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 PassRefPtr<WebCore::Range> WebPage::lookupTextAtLocation(FloatPoint locationInViewCooordinates, NSDictionary **options)