Diff
Modified: trunk/Source/WebKit2/ChangeLog (184105 => 184106)
--- trunk/Source/WebKit2/ChangeLog 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/ChangeLog 2015-05-11 17:38:51 UTC (rev 184106)
@@ -1,3 +1,23 @@
+2015-05-11 Tim Horton <[email protected]>
+
+ Page overlay action context override should indicate the source of the request
+ https://bugs.webkit.org/show_bug.cgi?id=144832
+ <rdar://problem/20562594>
+
+ Reviewed by Darin Adler.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
+ * WebProcess/WebPage/WebPageOverlay.cpp:
+ (WebKit::WebPageOverlay::actionContextForResultAtPoint):
+ * WebProcess/WebPage/WebPageOverlay.h:
+ (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::performActionMenuHitTestAtLocation):
+ Add a parameter to WKBundlePageOverlayActionContextForResultAtPoint so that
+ clients can tell whether the requested action context should be targetted
+ at an action menu or immediate action.
+
2015-05-11 Daniel Bates <[email protected]>
[iOS] Close all open databases in expiration handler of process assertion
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp (184105 => 184106)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp 2015-05-11 17:38:51 UTC (rev 184106)
@@ -44,7 +44,7 @@
namespace API {
template<> struct ClientTraits<WKBundlePageOverlayClientBase> {
- typedef std::tuple<WKBundlePageOverlayClientV0, WKBundlePageOverlayClientV1> Versions;
+ typedef std::tuple<WKBundlePageOverlayClientV0, WKBundlePageOverlayClientV1, WKBundlePageOverlayClientV2> Versions;
};
template<> struct ClientTraits<WKBundlePageOverlayAccessibilityClientBase> {
@@ -135,18 +135,29 @@
}
#if PLATFORM(MAC)
- virtual DDActionContext *actionContextForResultAtPoint(WebPageOverlay& pageOverlay, WebCore::FloatPoint location, RefPtr<WebCore::Range>& rangeHandle) override
+ virtual DDActionContext *actionContextForResultAtPoint(WebPageOverlay& pageOverlay, WebCore::FloatPoint location, RefPtr<WebCore::Range>& rangeHandle, bool forImmediateAction) override
{
- if (!m_client.actionContextForResultAtPoint)
- return nil;
+ if (m_client.actionContextForResultAtPoint) {
+ WKBundleRangeHandleRef apiRange = nullptr;
+ DDActionContext *actionContext = (DDActionContext *)m_client.actionContextForResultAtPoint(toAPI(&pageOverlay), WKPointMake(location.x(), location.y()), &apiRange, forImmediateAction ? kWKBundlePageOverlayActionContextForImmediateActionRequestType : kWKBundlePageOverlayActionContextForActionMenuRequestType, m_client.base.clientInfo);
- WKBundleRangeHandleRef apiRange = nullptr;
- DDActionContext *actionContext = (DDActionContext *)m_client.actionContextForResultAtPoint(toAPI(&pageOverlay), WKPointMake(location.x(), location.y()), &apiRange, m_client.base.clientInfo);
+ if (apiRange)
+ rangeHandle = toImpl(apiRange)->coreRange();
- if (apiRange)
- rangeHandle = toImpl(apiRange)->coreRange();
+ return actionContext;
+ }
- return actionContext;
+ if (m_client.actionContextForResultAtPoint_deprecatedForUseWithV1) {
+ WKBundleRangeHandleRef apiRange = nullptr;
+ DDActionContext *actionContext = (DDActionContext *)m_client.actionContextForResultAtPoint_deprecatedForUseWithV1(toAPI(&pageOverlay), WKPointMake(location.x(), location.y()), &apiRange, m_client.base.clientInfo);
+
+ if (apiRange)
+ rangeHandle = toImpl(apiRange)->coreRange();
+
+ return actionContext;
+ }
+
+ return nil;
}
virtual void dataDetectorsDidPresentUI(WebPageOverlay& pageOverlay) override
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h (184105 => 184106)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h 2015-05-11 17:38:51 UTC (rev 184106)
@@ -40,6 +40,12 @@
extern "C" {
#endif
+enum {
+ kWKBundlePageOverlayActionContextForActionMenuRequestType = 0,
+ kWKBundlePageOverlayActionContextForImmediateActionRequestType,
+};
+typedef uint32_t _WKBundlePageOverlayActionContextRequestType;
+
// Page overlay client.
typedef void (*WKBundlePageOverlayWillMoveToPageCallback)(WKBundlePageOverlayRef pageOverlay, WKBundlePageRef page, const void* clientInfo);
typedef void (*WKBundlePageOverlayDidMoveToPageCallback)(WKBundlePageOverlayRef pageOverlay, WKBundlePageRef page, const void* clientInfo);
@@ -49,10 +55,11 @@
typedef bool (*WKBundlePageOverlayMouseMovedCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, const void* clientInfo);
typedef bool (*WKBundlePageOverlayMouseDraggedCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo);
-typedef void* (*WKBundlePageOverlayActionContextForResultAtPointCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKBundleRangeHandleRef* rangeHandle, const void* clientInfo);
-typedef void (*WKBundlePageOverlayDatadetectorsDidPresentUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
-typedef void (*WKBundlePageOverlayDatadetectorsDidChangeUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
-typedef void (*WKBundlePageOverlayDatadetectorsDidHideUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
+typedef void* (*WKBundlePageOverlayActionContextForResultAtPointCallback_deprecatedForUseWithV1)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKBundleRangeHandleRef* rangeHandle, const void* clientInfo);
+typedef void* (*WKBundlePageOverlayActionContextForResultAtPointCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKBundleRangeHandleRef* rangeHandle, _WKBundlePageOverlayActionContextRequestType requestType, const void* clientInfo);
+typedef void (*WKBundlePageOverlayDataDetectorsDidPresentUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
+typedef void (*WKBundlePageOverlayDataDetectorsDidChangeUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
+typedef void (*WKBundlePageOverlayDataDetectorsDidHideUI)(WKBundlePageOverlayRef pageOverlay, const void* clientInfo);
typedef struct WKBundlePageOverlayClientBase {
int version;
@@ -83,11 +90,30 @@
WKBundlePageOverlayMouseDraggedCallback mouseDragged;
WKBundlePageOverlayActionContextForResultAtPointCallback actionContextForResultAtPoint;
- WKBundlePageOverlayDatadetectorsDidPresentUI dataDetectorsDidPresentUI;
- WKBundlePageOverlayDatadetectorsDidChangeUI dataDetectorsDidChangeUI;
- WKBundlePageOverlayDatadetectorsDidHideUI dataDetectorsDidHideUI;
+ WKBundlePageOverlayDataDetectorsDidPresentUI dataDetectorsDidPresentUI;
+ WKBundlePageOverlayDataDetectorsDidChangeUI dataDetectorsDidChangeUI;
+ WKBundlePageOverlayDataDetectorsDidHideUI dataDetectorsDidHideUI;
} WKBundlePageOverlayClientV1;
+typedef struct WKBundlePageOverlayClientV2 {
+ WKBundlePageOverlayClientBase base;
+
+ WKBundlePageOverlayWillMoveToPageCallback willMoveToPage;
+ WKBundlePageOverlayDidMoveToPageCallback didMoveToPage;
+ WKBundlePageOverlayDrawRectCallback drawRect;
+ WKBundlePageOverlayMouseDownCallback mouseDown;
+ WKBundlePageOverlayMouseUpCallback mouseUp;
+ WKBundlePageOverlayMouseMovedCallback mouseMoved;
+ WKBundlePageOverlayMouseDraggedCallback mouseDragged;
+
+ WKBundlePageOverlayActionContextForResultAtPointCallback_deprecatedForUseWithV1 actionContextForResultAtPoint_deprecatedForUseWithV1;
+ WKBundlePageOverlayDataDetectorsDidPresentUI dataDetectorsDidPresentUI;
+ WKBundlePageOverlayDataDetectorsDidChangeUI dataDetectorsDidChangeUI;
+ WKBundlePageOverlayDataDetectorsDidHideUI dataDetectorsDidHideUI;
+
+ WKBundlePageOverlayActionContextForResultAtPointCallback actionContextForResultAtPoint;
+} WKBundlePageOverlayClientV2;
+
enum { kWKBundlePageOverlayClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
typedef struct WKBundlePageOverlayClient {
int version;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp (184105 => 184106)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp 2015-05-11 17:38:51 UTC (rev 184106)
@@ -120,9 +120,9 @@
}
#if PLATFORM(MAC)
-DDActionContext *WebPageOverlay::actionContextForResultAtPoint(FloatPoint location, RefPtr<WebCore::Range>& rangeHandle)
+DDActionContext *WebPageOverlay::actionContextForResultAtPoint(FloatPoint location, RefPtr<WebCore::Range>& rangeHandle, bool forImmediateAction)
{
- return m_client->actionContextForResultAtPoint(*this, location, rangeHandle);
+ return m_client->actionContextForResultAtPoint(*this, location, rangeHandle, forImmediateAction);
}
void WebPageOverlay::dataDetectorsDidPresentUI()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h (184105 => 184106)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h 2015-05-11 17:38:51 UTC (rev 184106)
@@ -55,7 +55,7 @@
virtual void didScrollFrame(WebPageOverlay&, WebFrame*) { }
#if PLATFORM(MAC)
- virtual DDActionContext *actionContextForResultAtPoint(WebPageOverlay&, WebCore::FloatPoint location, RefPtr<WebCore::Range>& rangeHandle) { return nullptr; }
+ virtual DDActionContext *actionContextForResultAtPoint(WebPageOverlay&, WebCore::FloatPoint location, RefPtr<WebCore::Range>& rangeHandle, bool forImmediateAction) { return nullptr; }
virtual void dataDetectorsDidPresentUI(WebPageOverlay&) { }
virtual void dataDetectorsDidChangeUI(WebPageOverlay&) { }
virtual void dataDetectorsDidHideUI(WebPageOverlay&) { }
@@ -79,7 +79,7 @@
Client& client() const { return *m_client; }
#if PLATFORM(MAC)
- DDActionContext *actionContextForResultAtPoint(WebCore::FloatPoint, RefPtr<WebCore::Range>&);
+ DDActionContext *actionContextForResultAtPoint(WebCore::FloatPoint, RefPtr<WebCore::Range>&, bool forImmediateAction);
void dataDetectorsDidPresentUI();
void dataDetectorsDidChangeUI();
void dataDetectorsDidHideUI();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (184105 => 184106)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-05-11 17:38:51 UTC (rev 184106)
@@ -1133,7 +1133,7 @@
continue;
RefPtr<Range> mainResultRange;
- DDActionContext *actionContext = webOverlay->actionContextForResultAtPoint(locationInContentCoordinates, mainResultRange);
+ DDActionContext *actionContext = webOverlay->actionContextForResultAtPoint(locationInContentCoordinates, mainResultRange, forImmediateAction);
if (!actionContext || !mainResultRange)
continue;
Modified: trunk/Tools/ChangeLog (184105 => 184106)
--- trunk/Tools/ChangeLog 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Tools/ChangeLog 2015-05-11 17:38:51 UTC (rev 184106)
@@ -1,3 +1,14 @@
+2015-05-11 Tim Horton <[email protected]>
+
+ Page overlay action context override should indicate the source of the request
+ https://bugs.webkit.org/show_bug.cgi?id=144832
+ <rdar://problem/20562594>
+
+ Reviewed by Darin Adler.
+
+ * TestWebKitAPI/Tests/WebKit2ObjC/ActionMenusBundle.mm:
+ (TestWebKitAPI::ActionMenuTest::actionContextForResultAtPoint):
+
2015-05-10 Martin Robinson <[email protected]>
[GTK] fast/events/page-visibility-transition-test.html is timing out
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/ActionMenusBundle.mm (184105 => 184106)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/ActionMenusBundle.mm 2015-05-11 17:27:13 UTC (rev 184105)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/ActionMenusBundle.mm 2015-05-11 17:38:51 UTC (rev 184106)
@@ -92,7 +92,7 @@
*userData = WKDictionaryCreate(keys, values, 1);
}
- static void* actionContextForResultAtPoint(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKBundleRangeHandleRef* rangeHandle, const void* clientInfo)
+ static void* actionContextForResultAtPoint(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKBundleRangeHandleRef* rangeHandle, _WKBundlePageOverlayActionContextRequestType requestType, const void* clientInfo)
{
if (position.x > 700) {
RetainPtr<DDActionContext> actionContext = createActionContextForPhoneNumber();