[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:28:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9b98ee8481da7983320de2a21d4006836d5e4d05
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 4 13:45:41 2010 +0000

    2010-11-04  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Hook into QWebPage::scrollRequested for resizes-to-contents mode
    
            In RTC mode the QGraphicsWebView item is the size of the contents,
            scrolling works a bit differently  (we need to react to scrollRequested.)
    
            Normally QGraphicsView will replay the last mouse event when scrolling,
            so to prevent WebKit from getting confused by this we temporarily make
            the QGraphicsView non-interactive.
    
            * QtTestBrowser/webview.cpp:
            (WebViewGraphicsBased::setPage):
            (WebViewGraphicsBased::scrollRequested):
            * QtTestBrowser/webview.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71332 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index de6ad2b..bea93ba 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-04  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Hook into QWebPage::scrollRequested for resizes-to-contents mode
+
+        In RTC mode the QGraphicsWebView item is the size of the contents,
+        scrolling works a bit differently  (we need to react to scrollRequested.)
+
+        Normally QGraphicsView will replay the last mouse event when scrolling,
+        so to prevent WebKit from getting confused by this we temporarily make
+        the QGraphicsView non-interactive.
+
+        * QtTestBrowser/webview.cpp:
+        (WebViewGraphicsBased::setPage):
+        (WebViewGraphicsBased::scrollRequested):
+        * QtTestBrowser/webview.h:
+
 2010-11-04  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
index 242daf6..fffaf9c 100644
--- a/WebKitTools/QtTestBrowser/webview.cpp
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -59,9 +59,26 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
 void WebViewGraphicsBased::setPage(QWebPage* page)
 {
     connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&)));
+    connect(page, SIGNAL(scrollRequested(int, int, const QRect&)), SLOT(scrollRequested(int, int)));
     graphicsWebView()->setPage(page);
 }
 
+void WebViewGraphicsBased::scrollRequested(int x, int y)
+{
+    if (!m_resizesToContents)
+        return;
+
+    // Turn off interactive mode while scrolling, or QGraphicsView will replay the
+    // last mouse event which may cause WebKit to initiate a drag operation.
+    bool interactive = isInteractive();
+    setInteractive(false);
+
+    verticalScrollBar()->setValue(-y);
+    horizontalScrollBar()->setValue(-x);
+
+    setInteractive(interactive);
+}
+
 void WebViewGraphicsBased::contentsSizeChanged(const QSize& size)
 {
     if (m_resizesToContents)
diff --git a/WebKitTools/QtTestBrowser/webview.h b/WebKitTools/QtTestBrowser/webview.h
index e34d081..240ea89 100644
--- a/WebKitTools/QtTestBrowser/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -97,6 +97,7 @@ public slots:
     void animatedFlip();
     void animatedYFlip();
     void contentsSizeChanged(const QSize&);
+    void scrollRequested(int, int);
 
 signals:
     void currentFPSUpdated(int fps);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list