Title: [152878] trunk/Source/WebKit2
Revision
152878
Author
[email protected]
Date
2013-07-18 19:12:09 -0700 (Thu, 18 Jul 2013)

Log Message

[WK2] Share Qt port's codes to find zoomable area with CoordinatedGraphics.
https://bugs.webkit.org/show_bug.cgi?id=118585

Patch by Eunmi Lee <[email protected]> on 2013-07-18
Reviewed by Anders Carlsson.

The function to find zoomable area is needed in order to implement the
feature to scale for double-tap gesture. The WK2 EFL and NIX port want
to use that function, so extract the code from the Qt port, make it
usable in the CoordinatedGraphics and add API and callback.

* CMakeLists.txt:
* Target.pri:
* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewFindZoomableAreaForRect):
* UIProcess/API/C/CoordinatedGraphics/WKView.h:
* UIProcess/API/efl/EwkView.cpp:
(EwkView::didFindZoomableArea):
* UIProcess/API/efl/EwkView.h:
* UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Added.
(WebKit::WebPageProxy::findZoomableAreaForPoint):
(WebKit::WebPageProxy::didFindZoomableArea):
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::didFindZoomableArea):
(WebKit::WebView::findZoomableAreaForPoint):
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/CoordinatedGraphics/WebViewClient.cpp:
(WebKit::WebViewClient::didFindZoomableArea):
* UIProcess/CoordinatedGraphics/WebViewClient.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/efl/ViewClientEfl.cpp:
(WebKit::ViewClientEfl::didFindZoomableArea):
(WebKit::ViewClientEfl::ViewClientEfl):
* UIProcess/efl/ViewClientEfl.h:
* UIProcess/qt/WebPageProxyQt.cpp:
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Added.
(WebKit::WebPage::findZoomableAreaForPoint):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (152877 => 152878)


--- trunk/Source/WebKit2/CMakeLists.txt	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/CMakeLists.txt	2013-07-19 02:12:09 UTC (rev 152878)
@@ -366,6 +366,7 @@
     UIProcess/Authentication/WebProtectionSpace.cpp
 
     UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp
+    UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
 
     UIProcess/Downloads/DownloadProxy.cpp
     UIProcess/Downloads/DownloadProxyMap.cpp
@@ -519,6 +520,7 @@
     WebProcess/WebPage/WebUndoStep.cpp
 
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
+    WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
 )
 
 set(WebKit2_MESSAGES_IN_FILES

Modified: trunk/Source/WebKit2/ChangeLog (152877 => 152878)


--- trunk/Source/WebKit2/ChangeLog	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-19 02:12:09 UTC (rev 152878)
@@ -1,3 +1,47 @@
+2013-07-18  Eunmi Lee  <[email protected]>
+
+        [WK2] Share Qt port's codes to find zoomable area with CoordinatedGraphics.
+        https://bugs.webkit.org/show_bug.cgi?id=118585
+
+        Reviewed by Anders Carlsson.
+
+        The function to find zoomable area is needed in order to implement the
+        feature to scale for double-tap gesture. The WK2 EFL and NIX port want
+        to use that function, so extract the code from the Qt port, make it
+        usable in the CoordinatedGraphics and add API and callback.
+
+        * CMakeLists.txt:
+        * Target.pri:
+        * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
+        (WKViewFindZoomableAreaForRect):
+        * UIProcess/API/C/CoordinatedGraphics/WKView.h:
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::didFindZoomableArea):
+        * UIProcess/API/efl/EwkView.h:
+        * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Added.
+        (WebKit::WebPageProxy::findZoomableAreaForPoint):
+        (WebKit::WebPageProxy::didFindZoomableArea):
+        * UIProcess/CoordinatedGraphics/WebView.cpp:
+        (WebKit::WebView::didFindZoomableArea):
+        (WebKit::WebView::findZoomableAreaForPoint):
+        * UIProcess/CoordinatedGraphics/WebView.h:
+        * UIProcess/CoordinatedGraphics/WebViewClient.cpp:
+        (WebKit::WebViewClient::didFindZoomableArea):
+        * UIProcess/CoordinatedGraphics/WebViewClient.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/efl/ViewClientEfl.cpp:
+        (WebKit::ViewClientEfl::didFindZoomableArea):
+        (WebKit::ViewClientEfl::ViewClientEfl):
+        * UIProcess/efl/ViewClientEfl.h:
+        * UIProcess/qt/WebPageProxyQt.cpp:
+        * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Added.
+        (WebKit::WebPage::findZoomableAreaForPoint):
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2013-07-18  Simon Cooper  <[email protected]>
 
         Flash Player: deny file-read-data /Library/Application Support/Macromedia/FlashAuthor.cfg

Modified: trunk/Source/WebKit2/Target.pri (152877 => 152878)


--- trunk/Source/WebKit2/Target.pri	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/Target.pri	2013-07-19 02:12:09 UTC (rev 152878)
@@ -565,6 +565,7 @@
     UIProcess/BackingStore.cpp \
     UIProcess/qt/BackingStoreQt.cpp \
     UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp \
+    UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp \
     UIProcess/DefaultUndoController.cpp \
     UIProcess/Downloads/DownloadProxy.cpp \
     UIProcess/Downloads/DownloadProxyMap.cpp \
@@ -748,6 +749,7 @@
     WebProcess/WebPage/EventDispatcher.cpp \
     WebProcess/WebPage/FindController.cpp \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp \
+    WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp \
     WebProcess/WebPage/TapHighlightController.cpp \
     WebProcess/WebPage/LayerTreeHost.cpp \
     WebProcess/WebPage/PageBanner.cpp \

Modified: trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -26,6 +26,7 @@
 #include "WKAPICast.h"
 #include "WebView.h"
 
+using namespace WebCore;
 using namespace WebKit;
 
 WKViewRef WKViewCreate(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
@@ -188,4 +189,10 @@
     return toImpl(view)->opacity();
 }
 
+void WKViewFindZoomableAreaForRect(WKViewRef viewRef, WKRect wkRect)
+{
+    IntRect rect = toIntRect(wkRect);
+    toImpl(viewRef)->findZoomableAreaForPoint(rect.center(), rect.size());
+}
+
 #endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -36,6 +36,7 @@
 typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contentsSize, WKRect coveredRect, const void* clientInfo);
 typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo);
 typedef void (*WKViewPageDidChangeTooltipCallback)(WKViewRef view, WKStringRef newTooltip, const void* clientInfo);
+typedef void (*WKViewDidFindZoomableAreaCallback)(WKViewRef view, WKPoint point, WKRect area, const void* clientInfo);
 
 struct WKViewClient {
     int                                              version;
@@ -51,6 +52,7 @@
     WKViewCallback                                   didCompletePageTransition;
     WKViewPageDidChangeViewportAttributesCallback    didChangeViewportAttributes;
     WKViewPageDidChangeTooltipCallback               didChangeTooltip;
+    WKViewDidFindZoomableAreaCallback                didFindZoomableArea;
 };
 typedef struct WKViewClient WKViewClient;
 
@@ -103,6 +105,8 @@
 WK_EXPORT void WKViewSetOpacity(WKViewRef view, double opacity);
 WK_EXPORT double WKViewOpacity(WKViewRef view);
 
+WK_EXPORT void WKViewFindZoomableAreaForRect(WKViewRef, WKRect);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -29,6 +29,7 @@
 #include "NativeWebKeyboardEvent.h"
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
+#include "NotImplemented.h"
 #include "PageLoadClientEfl.h"
 #include "PagePolicyClientEfl.h"
 #include "PageUIClientEfl.h"
@@ -1374,6 +1375,11 @@
     return snapshot.release();
 }
 
+void EwkView::didFindZoomableArea(const WKPoint& point, const WKRect& area)
+{
+    notImplemented();
+}
+
 Evas_Smart_Class EwkView::parentSmartClass = EVAS_SMART_CLASS_INIT_NULL;
 
 // Free Ewk View functions.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -201,6 +201,8 @@
 
     PassRefPtr<cairo_surface_t> takeSnapshot();
 
+    void didFindZoomableArea(const WKPoint&, const WKRect&);
+
 private:
     EwkView(WKViewRef, Evas_Object*);
     ~EwkView();

Added: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp (0 => 152878)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2013 Samsung Electronics. 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.
+ */
+
+#include "config.h"
+#if USE(COORDINATED_GRAPHICS)
+
+#include "WebPageProxy.h"
+
+#include "PageClient.h"
+#include "WebPageMessages.h"
+#include "WebProcessProxy.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
+{
+    if (!isValid())
+        return;
+
+    m_process->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
+}
+
+void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
+{
+    m_pageClient->didFindZoomableArea(target, area);
+}
+
+} // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -207,6 +207,11 @@
     updateViewportSize();
 }
 
+void WebView::didFindZoomableArea(const WebCore::IntPoint& target, const WebCore::IntRect& area)
+{
+    m_client.didFindZoomableArea(this, target, area);
+}
+
 AffineTransform WebView::transformFromScene() const
 {
     return transformToScene().inverse();
@@ -499,6 +504,11 @@
     m_client.didCompletePageTransition(this);
 }
 
+void WebView::findZoomableAreaForPoint(const IntPoint& point, const IntSize& size)
+{
+    m_page->findZoomableAreaForPoint(transformFromScene().mapPoint(point), transformFromScene().mapSize(size));
+}
+
 } // namespace WebKit
 
 #endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -93,6 +93,8 @@
     bool exitFullScreen();
 #endif
 
+    void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
+
     // View client.
     void initializeClient(const WKViewClient*);
 
@@ -101,6 +103,7 @@
     void didChangeContentsSize(const WebCore::IntSize&);
     const WebCore::IntSize& contentsSize() const { return m_contentsSize; }
     WebCore::FloatSize visibleContentsSize() const;
+    void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
 
     // FIXME: Should become private when Web Events creation is moved to WebView.
     WebCore::AffineTransform transformFromScene() const;

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -111,6 +111,14 @@
     m_client.didChangeTooltip(toAPI(view), adoptWK(toCopiedAPI(tooltip)).get(), m_client.clientInfo);
 }
 
+void WebViewClient::didFindZoomableArea(WebView* view, const IntPoint& target, const IntRect& area)
+{
+    if (!m_client.didFindZoomableArea)
+        return;
+
+    m_client.didFindZoomableArea(toAPI(view), toAPI(target), toAPI(area), m_client.clientInfo);
+}
+
 } // namespace WebKit
 
 #endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -54,6 +54,7 @@
     void didCompletePageTransition(WebView*);
     void didChangeViewportAttributes(WebView*, const WebCore::ViewportAttributes&);
     void didChangeTooltip(WebView*, const String& tooltip);
+    void didFindZoomableArea(WebView*, const WebCore::IntPoint&, const WebCore::IntRect&);
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -121,8 +121,10 @@
     virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) = 0;
     virtual void pageTransitionViewportReady() = 0;
 #endif
+#if USE(COORDINATED_GRAPHICS)
+    virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;
+#endif
 #if PLATFORM(QT)
-    virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;
     virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) = 0;
     virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) = 0;
     virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password) = 0;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -662,7 +662,7 @@
 
     WebPageCreationParameters creationParameters() const;
 
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
 #endif
 
@@ -887,10 +887,9 @@
     void pageDidRequestScroll(const WebCore::IntPoint&);
     void pageTransitionViewportReady();
 #endif
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
 #endif
-
 #if PLATFORM(QT) || PLATFORM(EFL)
     void didChangeContentsSize(const WebCore::IntSize&);
 #endif

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2013-07-19 02:12:09 UTC (rev 152878)
@@ -77,8 +77,10 @@
     PageDidRequestScroll(WebCore::IntPoint point)
     PageTransitionViewportReady()
 #endif
+#if USE(COORDINATED_GRAPHICS)
+    DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)
+#endif
 #if PLATFORM(QT)
-    DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)
     AuthenticationRequiredRequest(WTF::String hostname, WTF::String realm, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password)
     CertificateVerificationRequest(WTF::String hostname) -> (bool ignoreErrors)
     ProxyAuthenticationRequiredRequest(WTF::String hostname, uint16_t port, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password)

Modified: trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -154,6 +154,11 @@
         toEwkView(clientInfo)->smartCallback<TooltipTextSet>().call(WKEinaSharedString(tooltip));
 }
 
+void ViewClientEfl::didFindZoomableArea(WKViewRef, WKPoint point, WKRect area, const void* clientInfo)
+{
+    toEwkView(clientInfo)->didFindZoomableArea(point, area);
+}
+
 ViewClientEfl::ViewClientEfl(EwkView* view)
     : m_view(view)
 {
@@ -164,6 +169,7 @@
     viewClient.version = kWKViewClientCurrentVersion;
     viewClient.clientInfo = this;
     viewClient.didChangeContentsSize = didChangeContentsSize;
+    viewClient.didFindZoomableArea = didFindZoomableArea;
     viewClient.viewNeedsDisplay = viewNeedsDisplay;
     viewClient.webProcessCrashed = webProcessCrashed;
     viewClient.webProcessDidRelaunch = webProcessDidRelaunch;

Modified: trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -56,6 +56,7 @@
     static void didCompletePageTransition(WKViewRef, const void* clientInfo);
     static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo);
     static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo);
+    static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo);
 
     EwkView* m_view;
 };

Modified: trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp (152877 => 152878)


--- trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -86,19 +86,6 @@
 #endif
 }
 
-void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
-{
-    m_pageClient->didFindZoomableArea(target, area);
-}
-
-void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
-{
-    if (!isValid())
-        return;
-
-    m_process->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);
-}
-
 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password)
 {
     m_pageClient->handleAuthenticationRequiredRequest(hostname, realm, prefilledUsername, username, password);

Added: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp (0 => 152878)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2013 Samsung Electronics. 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.
+ */
+
+#include "config.h"
+#if USE(COORDINATED_GRAPHICS)
+
+#include "WebPage.h"
+
+#include "HitTestResult.h"
+#include "WebCoreArgumentCoders.h"
+#include "WebFrame.h"
+#include "WebPageProxyMessages.h"
+#include <WebCore/EventHandler.h>
+#include <WebCore/Frame.h>
+#include <WebCore/FrameView.h>
+#include <WebCore/ScrollView.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+#if ENABLE(TOUCH_ADJUSTMENT)
+void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
+{
+    Node* node = 0;
+    IntRect zoomableArea;
+    bool foundAreaForTouchPoint = m_mainFrame->coreFrame()->eventHandler()->bestZoomableAreaForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), zoomableArea, node);
+
+    if (!foundAreaForTouchPoint)
+        return;
+
+    ASSERT(node);
+
+    if (node->document() && node->document()->view())
+        zoomableArea = node->document()->view()->contentsToWindow(zoomableArea);
+
+    send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
+}
+
+#else
+void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
+{
+    UNUSED_PARAM(area);
+    Frame* mainframe = m_mainFrame->coreFrame();
+    HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
+
+    Node* node = result.innerNode();
+
+    if (!node)
+        return;
+
+    IntRect zoomableArea = node->pixelSnappedBoundingBox();
+
+    while (true) {
+        bool found = !node->isTextNode() && !node->isShadowRoot();
+
+        // No candidate found, bail out.
+        if (!found && !node->parentNode())
+            return;
+
+        // Candidate found, and it is a better candidate than its parent.
+        // NB: A parent is considered a better candidate iff the node is
+        // contained by it and it is the only child.
+        if (found && (!node->parentNode() || node->parentNode()->childNodeCount() != 1))
+            break;
+
+        node = node->parentNode();
+        zoomableArea.unite(node->pixelSnappedBoundingBox());
+    }
+
+    if (node->document() && node->document()->frame() && node->document()->frame()->view()) {
+        const ScrollView* view = node->document()->frame()->view();
+        zoomableArea = view->contentsToWindow(zoomableArea);
+    }
+
+    send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
+}
+#endif
+
+} // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (152877 => 152878)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-07-19 02:12:09 UTC (rev 152878)
@@ -3177,66 +3177,6 @@
     return m_backForwardList.get();
 }
 
-#if PLATFORM(QT)
-#if ENABLE(TOUCH_ADJUSTMENT)
-void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const WebCore::IntSize& area)
-{
-    Node* node = 0;
-    IntRect zoomableArea;
-    bool foundAreaForTouchPoint = m_mainFrame->coreFrame()->eventHandler()->bestZoomableAreaForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), zoomableArea, node);
-
-    if (!foundAreaForTouchPoint)
-        return;
-
-    ASSERT(node);
-
-    if (node->document() && node->document()->view())
-        zoomableArea = node->document()->view()->contentsToWindow(zoomableArea);
-
-    send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
-}
-
-#else
-void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const WebCore::IntSize& area)
-{
-    UNUSED_PARAM(area);
-    Frame* mainframe = m_mainFrame->coreFrame();
-    HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
-
-    Node* node = result.innerNode();
-
-    if (!node)
-        return;
-
-    IntRect zoomableArea = node->pixelSnappedBoundingBox();
-
-    while (true) {
-        bool found = !node->isTextNode() && !node->isShadowRoot();
-
-        // No candidate found, bail out.
-        if (!found && !node->parentNode())
-            return;
-
-        // Candidate found, and it is a better candidate than its parent.
-        // NB: A parent is considered a better candidate iff the node is
-        // contained by it and it is the only child.
-        if (found && (!node->parentNode() || node->parentNode()->childNodeCount() != 1))
-            break;
-
-        node = node->parentNode();
-        zoomableArea.unite(node->pixelSnappedBoundingBox());
-    }
-
-    if (node->document() && node->document()->frame() && node->document()->frame()->view()) {
-        const ScrollView* view = node->document()->frame()->view();
-        zoomableArea = view->contentsToWindow(zoomableArea);
-    }
-
-    send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
-}
-#endif
-#endif
-
 WebPage::SandboxExtensionTracker::~SandboxExtensionTracker()
 {
     invalidate();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (152877 => 152878)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-07-19 02:12:09 UTC (rev 152878)
@@ -794,7 +794,7 @@
     void hideFindUI();
     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
 
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area);
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (152877 => 152878)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-07-19 01:32:58 UTC (rev 152877)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-07-19 02:12:09 UTC (rev 152878)
@@ -297,7 +297,7 @@
     SetComposition(WTF::String compositionString, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t cursorPosition)
     CancelComposition()
 #endif
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area)
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to