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

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:21:25 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 11505559854e580915a6f490d450bdf46dfb5031
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 12:11:56 2010 +0000

    2010-07-20  Kenneth Rohde Christiansen  <kenneth.christiansen at openbossa.org>
    
            [Qt] Add API to define device-width and height for use with the viewport meta tag
            https://bugs.webkit.org/show_bug.cgi?id=42597
    
            Reviewed by Antonio Gomes.
    
            Add a new API for setting the deviceSize for use in conjunction with
            out viewport meta tag API.
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebView::setDeviceSize):
            (QGraphicsWebView::deviceSize):
            * Api/qgraphicswebview.h:
            * WebCoreSupport/PageClientQt.cpp:
            (WebCore::PageClientQGraphicsWidget::windowRect):
            * WebCoreSupport/PageClientQt.h:
            (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63740 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 6d6acc5..8fbb8e2 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -73,6 +73,7 @@ public:
     QGraphicsWebView* q;
     QWebPage* page;
     bool resizesToContents;
+    QSize deviceSize;
 
     // Just a convenience to avoid using page->client->overlay always
     QSharedPointer<QGraphicsItemOverlay> overlay;
@@ -549,6 +550,24 @@ QIcon QGraphicsWebView::icon() const
 }
 
 /*!
+    \property QGraphicsWebView::deviceSize
+    \brief the size of the device using the web view
+
+    The device size is used by the DOM window object methods
+    otherHeight(), otherWidth() as well as a page for the viewport
+    meta tag attributes device-width and device-height.
+*/
+void QGraphicsWebView::setDeviceSize(const QSize& size)
+{
+    d->deviceSize = size;
+}
+
+QSize QGraphicsWebView::deviceSize() const
+{
+    return d->deviceSize;
+}
+
+/*!
     \property QGraphicsWebView::zoomFactor
     \brief the zoom factor for the view
 */
diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h
index 88729d3..8650984 100644
--- a/WebKit/qt/Api/qgraphicswebview.h
+++ b/WebKit/qt/Api/qgraphicswebview.h
@@ -41,6 +41,7 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
     Q_PROPERTY(QString title READ title NOTIFY titleChanged)
     Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
     Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+    Q_PROPERTY(QSize deviceSize READ deviceSize WRITE setDeviceSize)
 
     Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
 
@@ -64,9 +65,12 @@ public:
     qreal zoomFactor() const;
     void setZoomFactor(qreal);
 
+    QSize deviceSize() const;
+    void setDeviceSize(const QSize&);
+
     bool isModified() const;
 
-    void load(const QUrl &url);
+    void load(const QUrl& url);
     void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
 
     void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index b83bab7..edc8f52 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-20  Kenneth Rohde Christiansen  <kenneth.christiansen at openbossa.org>
+
+        [Qt] Add API to define device-width and height for use with the viewport meta tag
+        https://bugs.webkit.org/show_bug.cgi?id=42597
+
+        Reviewed by Antonio Gomes.
+
+        Add a new API for setting the deviceSize for use in conjunction with
+        out viewport meta tag API.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::setDeviceSize):
+        (QGraphicsWebView::deviceSize):
+        * Api/qgraphicswebview.h:
+        * WebCoreSupport/PageClientQt.cpp:
+        (WebCore::PageClientQGraphicsWidget::windowRect):
+        * WebCoreSupport/PageClientQt.h:
+        (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
+
 2010-07-20  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index f52c382..90a5a63 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -324,6 +324,9 @@ QStyle* PageClientQGraphicsWidget::style() const
 
 QRectF PageClientQGraphicsWidget::windowRect() const
 {
+    if (!view->deviceSize().isEmpty())
+        return QRectF(QRect(QPoint(0, 0), view->deviceSize()));
+
     if (!view->scene())
         return QRectF();
 
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 4d42ca1..1204afc 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -26,11 +26,11 @@
 #include "IntRect.h"
 #include "QWebPageClient.h"
 #include "TiledBackingStore.h"
+#include "qgraphicswebview.h"
 #include "qwebframe.h"
 #include "qwebframe_p.h"
 #include "qwebpage.h"
 #include "qwebpage_p.h"
-
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qsharedpointer.h>
 #include <QtGui/qgraphicsscene.h>
@@ -42,7 +42,6 @@
 
 #include <Settings.h>
 
-
 namespace WebCore {
 
 class PageClientQWidget : public QWebPageClient {
@@ -122,7 +121,7 @@ class QGraphicsItemOverlay : public QGraphicsItem {
 
 class PageClientQGraphicsWidget : public QWebPageClient {
 public:
-    PageClientQGraphicsWidget(QGraphicsWidget* v, QWebPage* p)
+    PageClientQGraphicsWidget(QGraphicsWebView* v, QWebPage* p)
         : view(v)
         , page(p)
         , viewResizesToContents(false)
@@ -186,7 +185,7 @@ public:
 
     virtual QRectF windowRect() const;
 
-    QGraphicsWidget* view;
+    QGraphicsWebView* view;
     QWebPage* page;
     bool viewResizesToContents;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list