[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 15:54:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e2c8619aa07874eabc4b95a0b84e76c3bcb6a3cc
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 16 16:14:22 2010 +0000

    2010-11-16  Kenneth Rohde Christiansen  <kenneth at webkit.org>, Zalan Bujtas  <zbujtas at gmail.com>
    
            Reviewed by Andreas Kling.
    
            [WK2][Qt] Add API for finding a zoomable area for a given point
    
            This is useful for implementing e.g "double tap zoom"
    
            Only enabled for Qt.
    
            * UIProcess/API/qt/qwkpage.cpp:
            (QWKPage::findZoomableAreaForPoint):
            (QWKPagePrivate::didFindZoomableArea):
            * UIProcess/API/qt/qwkpage.h:
            * UIProcess/API/qt/qwkpage_p.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didFindZoomableArea):
            (WebKit::WebPageProxy::findZoomableAreaForPoint):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::findZoomableAreaForPoint):
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 7c783f5..dd29a26 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,29 @@
+2010-11-16  Kenneth Rohde Christiansen  <kenneth at webkit.org>, Zalan Bujtas  <zbujtas at gmail.com>
+
+        Reviewed by Andreas Kling.
+
+        [WK2][Qt] Add API for finding a zoomable area for a given point
+
+        This is useful for implementing e.g "double tap zoom"
+
+        Only enabled for Qt.
+
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPage::findZoomableAreaForPoint):
+        (QWKPagePrivate::didFindZoomableArea):
+        * UIProcess/API/qt/qwkpage.h:
+        * UIProcess/API/qt/qwkpage_p.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didFindZoomableArea):
+        (WebKit::WebPageProxy::findZoomableAreaForPoint):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::findZoomableAreaForPoint):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2010-11-16  Andreas Kling  <kling at webkit.org>
 
         Rubber-stamped by Simon Hausmann.
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index bcb4bfe..6dff153 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -613,4 +613,14 @@ QAction* QWKPage::action(WebAction action) const
 }
 #endif // QT_NO_ACTION
 
+void QWKPage::findZoomableAreaForPoint(const QPoint& point)
+{
+    d->page->findZoomableAreaForPoint(point);
+}
+
+void QWKPagePrivate::didFindZoomableArea(const IntRect& area)
+{
+    emit q->zoomableAreaFound(QRect(area));
+}
+
 #include "moc_qwkpage.cpp"
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.h b/WebKit2/UIProcess/API/qt/qwkpage.h
index 8770edb..882b38f 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage.h
@@ -102,6 +102,8 @@ public:
 
     QWKHistory* history() const;
 
+    void findZoomableAreaForPoint(const QPoint&);
+
 public:
     Q_SIGNAL void statusBarMessage(const QString&);
     Q_SIGNAL void titleChanged(const QString&);
@@ -115,6 +117,7 @@ public:
     Q_SIGNAL void cursorChanged(const QCursor&);
     Q_SIGNAL void viewportChangeRequested();
     Q_SIGNAL void windowCloseRequested();
+    Q_SIGNAL void zoomableAreaFound(const QRect&);
 
 protected:
     void timerEvent(QTimerEvent*);
diff --git a/WebKit2/UIProcess/API/qt/qwkpage_p.h b/WebKit2/UIProcess/API/qt/qwkpage_p.h
index 6bef745..496f7c3 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage_p.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage_p.h
@@ -52,6 +52,7 @@ public:
     virtual void processDidCrash() { }
     virtual void didRelaunchProcess() { }
     virtual void didChangeContentsSize(const WebCore::IntSize&);
+    virtual void didFindZoomableArea(const WebCore::IntRect&);
     virtual void setCursor(const WebCore::Cursor&);
     virtual void setViewportArguments(const WebCore::ViewportArguments&);
     virtual void takeFocus(bool direction) { }
diff --git a/WebKit2/UIProcess/PageClient.h b/WebKit2/UIProcess/PageClient.h
index da81c68..c3e5a6a 100644
--- a/WebKit2/UIProcess/PageClient.h
+++ b/WebKit2/UIProcess/PageClient.h
@@ -59,6 +59,7 @@ public:
 #endif
 #if PLATFORM(QT)
     virtual void didChangeContentsSize(const WebCore::IntSize&) = 0;
+    virtual void didFindZoomableArea(const WebCore::IntRect&) = 0;
 #endif
 
     virtual void setCursor(const WebCore::Cursor&) = 0;
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index b9d53b6..4093da2 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1075,6 +1075,19 @@ void WebPageProxy::didChangeContentsSize(const WebCore::IntSize& size)
 {
     m_pageClient->didChangeContentsSize(size);
 }
+
+void WebPageProxy::didFindZoomableArea(const WebCore::IntRect& area)
+{
+    m_pageClient->didFindZoomableArea(area);
+}
+
+void WebPageProxy::findZoomableAreaForPoint(const WebCore::IntPoint& point)
+{
+    if (!isValid())
+        return;
+
+    process()->send(Messages::WebPage::FindZoomableAreaForPoint(point), m_pageID);
+}
 #endif
 
 void WebPageProxy::didDraw()
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 1efb430..a37c749 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -252,6 +252,10 @@ public:
 
     WebPageCreationParameters creationParameters(const WebCore::IntSize&) const;
 
+#if PLATFORM(QT)
+    void findZoomableAreaForPoint(const WebCore::IntPoint&);
+#endif
+
 private:
     WebPageProxy(WebPageNamespace*, uint64_t pageID);
 
@@ -316,6 +320,7 @@ private:
 #endif
 #if PLATFORM(QT)
     void didChangeContentsSize(const WebCore::IntSize&);
+    void didFindZoomableArea(const WebCore::IntRect&);
 #endif
 
     // Back/Forward list management
diff --git a/WebKit2/UIProcess/WebPageProxy.messages.in b/WebKit2/UIProcess/WebPageProxy.messages.in
index fd7d6a8..d0da568 100644
--- a/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -55,6 +55,7 @@ messages -> WebPageProxy {
 #endif
 #if PLATFORM(QT)
     DidChangeContentsSize(WebCore::IntSize newSize)
+    DidFindZoomableArea(WebCore::IntRect area)
 #endif
 
     # Policy messages.
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 2027376..14c3df7 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -27,6 +27,9 @@
 
 #include "Arguments.h"
 #include "DrawingArea.h"
+#if PLATFORM(QT)
+#include "HitTestResult.h"
+#endif
 #include "InjectedBundle.h"
 #include "InjectedBundleBackForwardList.h"
 #include "MessageID.h"
@@ -1071,4 +1074,24 @@ InjectedBundleBackForwardList* WebPage::backForwardList()
     return m_backForwardList.get();
 }
 
+#if PLATFORM(QT)
+void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point)
+{
+    const int minimumZoomTargetWidth = 100;
+
+    Frame* mainframe = m_mainFrame->coreFrame();
+    HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+
+    Node* node = result.innerNode();
+    while (node && node->getRect().width() < minimumZoomTargetWidth)
+        node = node->parent();
+
+    IntRect zoomableArea;
+    if (node)
+        zoomableArea = node->getRect();
+    send(Messages::WebPageProxy::DidFindZoomableArea(zoomableArea));
+}
+
+#endif
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 90d6085..491be53 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -268,6 +268,10 @@ private:
     void hideFindUI();
     void countStringMatches(const String&, bool caseInsensitive, uint32_t maxMatchCount);
 
+#if PLATFORM(QT)
+    void findZoomableAreaForPoint(const WebCore::IntPoint&);
+#endif
+
     void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex);
 
 #if ENABLE(CONTEXT_MENUS)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 36ce81a..445a4e7 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -94,4 +94,8 @@ messages -> WebPage {
     SetWindowIsVisible(bool windowIsVisible)
     SetWindowFrame(WebCore::IntRect windowFrame)
 #endif
+
+#if PLATFORM(QT)
+    FindZoomableAreaForPoint(WebCore::IntPoint point)
+#endif
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list