[WK2] Share Qt port's codes to find zoomable area with CoordinatedGraphics.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jul 2013 02:12:09 +0000 (02:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jul 2013 02:12:09 +0000 (02:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118585

Patch by Eunmi Lee <eunmi15.lee@samsung.com> 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:

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

22 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Target.pri
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h
Source/WebKit2/UIProcess/API/efl/EwkView.cpp
Source/WebKit2/UIProcess/API/efl/EwkView.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp
Source/WebKit2/UIProcess/efl/ViewClientEfl.h
Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

index c2144c0..dbaac52 100644 (file)
@@ -366,6 +366,7 @@ set(WebKit2_SOURCES
     UIProcess/Authentication/WebProtectionSpace.cpp
 
     UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp
+    UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
 
     UIProcess/Downloads/DownloadProxy.cpp
     UIProcess/Downloads/DownloadProxyMap.cpp
@@ -519,6 +520,7 @@ set(WebKit2_SOURCES
     WebProcess/WebPage/WebUndoStep.cpp
 
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
+    WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
 )
 
 set(WebKit2_MESSAGES_IN_FILES
index 8797139..90a3312 100644 (file)
@@ -1,3 +1,47 @@
+2013-07-18  Eunmi Lee  <eunmi15.lee@samsung.com>
+
+        [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  <scooper@apple.com>
 
         Flash Player: deny file-read-data /Library/Application Support/Macromedia/FlashAuthor.cfg
index fe6336a..9874bc7 100644 (file)
@@ -565,6 +565,7 @@ SOURCES += \
     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 @@ SOURCES += \
     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 \
index 467365f..2ed74d3 100644 (file)
@@ -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 @@ double WKViewOpacity(WKViewRef view)
     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)
index cd30e48..d8bc781 100644 (file)
@@ -36,6 +36,7 @@ typedef void (*WKViewPageDidChangeContentsPositionCallback)(WKViewRef view, WKPo
 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 @@ struct WKViewClient {
     WKViewCallback                                   didCompletePageTransition;
     WKViewPageDidChangeViewportAttributesCallback    didChangeViewportAttributes;
     WKViewPageDidChangeTooltipCallback               didChangeTooltip;
+    WKViewDidFindZoomableAreaCallback                didFindZoomableArea;
 };
 typedef struct WKViewClient WKViewClient;
 
@@ -103,6 +105,8 @@ WK_EXPORT bool WKViewExitFullScreen(WKViewRef);
 WK_EXPORT void WKViewSetOpacity(WKViewRef view, double opacity);
 WK_EXPORT double WKViewOpacity(WKViewRef view);
 
+WK_EXPORT void WKViewFindZoomableAreaForRect(WKViewRef, WKRect);
+
 #ifdef __cplusplus
 }
 #endif
index b336110..0681d88 100644 (file)
@@ -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 @@ PassRefPtr<cairo_surface_t> EwkView::takeSnapshot()
     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.
index 04317a6..67a468d 100644 (file)
@@ -201,6 +201,8 @@ public:
 
     PassRefPtr<cairo_surface_t> takeSnapshot();
 
+    void didFindZoomableArea(const WKPoint&, const WKRect&);
+
 private:
     EwkView(WKViewRef, Evas_Object*);
     ~EwkView();
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
new file mode 100644 (file)
index 0000000..e34a9b3
--- /dev/null
@@ -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)
index 040ce1b..668347e 100644 (file)
@@ -207,6 +207,11 @@ void WebView::didChangeContentsSize(const WebCore::IntSize& size)
     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 @@ void WebView::pageTransitionViewportReady()
     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)
index bb5e72d..0f04623 100644 (file)
@@ -93,6 +93,8 @@ public:
     bool exitFullScreen();
 #endif
 
+    void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
+
     // View client.
     void initializeClient(const WKViewClient*);
 
@@ -101,6 +103,7 @@ public:
     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;
index ccc435f..c1ead36 100644 (file)
@@ -111,6 +111,14 @@ void WebViewClient::didChangeTooltip(WebView* view, const String& tooltip)
     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)
index 44bf4dd..6222329 100644 (file)
@@ -54,6 +54,7 @@ public:
     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
index f86f1de..0df2c20 100644 (file)
@@ -121,8 +121,10 @@ public:
     virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) = 0;
     virtual void pageTransitionViewportReady() = 0;
 #endif
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;
+#endif
+#if PLATFORM(QT)
     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;
index 26199c1..55a7a69 100644 (file)
@@ -662,7 +662,7 @@ public:
 
     WebPageCreationParameters creationParameters() const;
 
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&);
 #endif
 
@@ -887,10 +887,9 @@ private:
     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
index 8a11dd7..6c15385 100644 (file)
@@ -77,8 +77,10 @@ messages -> WebPageProxy {
     PageDidRequestScroll(WebCore::IntPoint point)
     PageTransitionViewportReady()
 #endif
-#if PLATFORM(QT)
+#if USE(COORDINATED_GRAPHICS)
     DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)
+#endif
+#if PLATFORM(QT)
     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)
index 0e66eab..f128910 100644 (file)
@@ -154,6 +154,11 @@ void ViewClientEfl::didChangeTooltip(WKViewRef, WKStringRef tooltip, const void*
         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 @@ ViewClientEfl::ViewClientEfl(EwkView* view)
     viewClient.version = kWKViewClientCurrentVersion;
     viewClient.clientInfo = this;
     viewClient.didChangeContentsSize = didChangeContentsSize;
+    viewClient.didFindZoomableArea = didFindZoomableArea;
     viewClient.viewNeedsDisplay = viewNeedsDisplay;
     viewClient.webProcessCrashed = webProcessCrashed;
     viewClient.webProcessDidRelaunch = webProcessDidRelaunch;
index 3f18bea..1bee369 100644 (file)
@@ -56,6 +56,7 @@ private:
     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;
 };
index 4f26d65..a897825 100644 (file)
@@ -86,19 +86,6 @@ void WebPageProxy::sendApplicationSchemeReply(const QQuickNetworkReply* reply)
 #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);
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
new file mode 100644 (file)
index 0000000..bc50059
--- /dev/null
@@ -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)
index 127db98..ed3eac0 100644 (file)
@@ -3177,66 +3177,6 @@ InjectedBundleBackForwardList* WebPage::backForwardList()
     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();
index 9d94a2d..3a25ca1 100644 (file)
@@ -794,7 +794,7 @@ private:
     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
 
index 49d3c40..8a6b574 100644 (file)
@@ -297,7 +297,7 @@ messages -> WebPage LegacyReceiver {
     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