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

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 11:52:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1dfd2cf33905941feafaf3b2a55371cffed55ebc
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 10 04:00:26 2010 +0000

    2010-08-09  Antonio Gomes  <tonikitoo at webkit.org>
    
            eviewed by Ariya Hidayat.
    
            [Qt] QtTestBrowser: proper set scene rect
    
            When resizesToContents is ON scene's rect is set to the boundary of
            the mainFrame. However, navigating to other web page should keep resizing
            scene's rect according to the new document loaded. Patch addresses this issue.
    
            Now resizesToContents and scrolling properly work on QtTestBrowser.
    
            * QtTestBrowser/webview.cpp:
            (WebViewGraphicsBased::setPage):
            (WebViewGraphicsBased::contentsSizeChanged):
            (WebViewGraphicsBased::setResizesToContents):
            (WebViewGraphicsBased::resizeEvent):
            * QtTestBrowser/webview.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c5f3747..e911169 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,25 @@
 
         Reviewed by Ariya Hidayat.
 
+        [Qt] QtTestBrowser: proper set scene rect
+
+        When resizesToContents is ON scene's rect is set to the boundary of
+        the mainFrame. However, navigating to other web page should keep resizing
+        scene's rect according to the new document loaded. Patch addresses this issue.
+
+        Now resizesToContents and scrolling properly work on QtTestBrowser.
+
+        * QtTestBrowser/webview.cpp:
+        (WebViewGraphicsBased::setPage):
+        (WebViewGraphicsBased::contentsSizeChanged):
+        (WebViewGraphicsBased::setResizesToContents):
+        (WebViewGraphicsBased::resizeEvent):
+        * QtTestBrowser/webview.h:
+
+2010-08-09  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Ariya Hidayat.
+
         [Qt] QtTestBrowser: Clean up LauncherWindow code.
 
         * QtTestBrowser/launcherwindow.cpp:
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
index e456f90..c8eecd6 100644
--- a/WebKitTools/QtTestBrowser/webview.cpp
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -79,6 +79,18 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
     connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
 }
 
+void WebViewGraphicsBased::setPage(QWebPage* page)
+{
+    connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&)));
+    m_item->setPage(page);
+}
+
+void WebViewGraphicsBased::contentsSizeChanged(const QSize& size)
+{
+    if (m_resizesToContents)
+        scene()->setSceneRect(0, 0, size.width(), size.height());
+}
+
 void WebViewGraphicsBased::setResizesToContents(bool b)
 {
     if (b == m_resizesToContents)
@@ -105,8 +117,10 @@ void WebViewGraphicsBased::setResizesToContents(bool b)
     if (m_resizesToContents) {
         setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
         setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-        scene()->setSceneRect(QRectF());
         m_item->page()->setPreferredContentsSize(size());
+        QRectF itemRect(m_item->geometry().topLeft(), m_item->page()->mainFrame()->contentsSize());
+        m_item->setGeometry(itemRect);
+        scene()->setSceneRect(itemRect);
     } else {
         setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
         setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
diff --git a/WebKitTools/QtTestBrowser/webview.h b/WebKitTools/QtTestBrowser/webview.h
index 433844c..5e7c0c3 100644
--- a/WebKitTools/QtTestBrowser/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -71,22 +71,20 @@ class WebViewGraphicsBased : public QGraphicsView {
 
 public:
     WebViewGraphicsBased(QWidget* parent);
-    virtual void resizeEvent(QResizeEvent*);
-    void setPage(QWebPage* page) { m_item->setPage(page); }
+    void setPage(QWebPage* page);
+
     void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
     QGraphicsItem::CacheMode itemCacheMode() { return m_item->cacheMode(); }
 
     void setFrameRateMeasurementEnabled(bool enabled);
     bool frameRateMeasurementEnabled() const { return m_measureFps; }
 
+    virtual void resizeEvent(QResizeEvent*);
     virtual void paintEvent(QPaintEvent* event);
 
     void setResizesToContents(bool b);
     bool resizesToContents() const { return m_resizesToContents; }
 
-    void setCustomLayoutSize(const QSize& size) { return m_item->page()->setPreferredContentsSize(size); }
-    QSize customLayoutSize() const { return m_item->page()->preferredContentsSize(); }
-
     void setYRotation(qreal angle)
     {
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
@@ -109,6 +107,7 @@ public slots:
     void updateFrameRate();
     void animatedFlip();
     void animatedYFlip();
+    void contentsSizeChanged(const QSize&);
 
 signals:
     void yFlipRequest();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list