Diff
Modified: trunk/ChangeLog (102921 => 102922)
--- trunk/ChangeLog 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/ChangeLog 2011-12-15 12:38:42 UTC (rev 102922)
@@ -1,3 +1,17 @@
+2011-12-15 Michael Brüning <[email protected]>
+
+ [QT][WK2]Add (experimental) viewport info view to Minibrowser/qt.
+ https://bugs.webkit.org/show_bug.cgi?id=72893
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch extends QQuickWebViewExperimental by a property named
+ viewportInfo, which contains the viewport scalability and
+ layout and contents size information. This property is exposed to
+ QML through the experimental extension for QQuickWebView.
+
+ * Source/qtwebkit-export.map:
+
2011-12-14 Ryosuke Niwa <[email protected]>
Add a manual test for caret blinking during forward deletion
Modified: trunk/Source/WebKit/qt/ChangeLog (102921 => 102922)
--- trunk/Source/WebKit/qt/ChangeLog 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit/qt/ChangeLog 2011-12-15 12:38:42 UTC (rev 102922)
@@ -1,3 +1,17 @@
+2011-12-15 Michael Brüning <[email protected]>
+
+ [QT][WK2]Add (experimental) viewport info view to Minibrowser/qt.
+ https://bugs.webkit.org/show_bug.cgi?id=72893
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch extends QQuickWebViewExperimental by a property named
+ viewportInfo, which contains the viewport scalability and
+ layout and contents size information. This property is exposed to
+ QML through the experimental extension for QQuickWebView.
+
+ * declarative/experimental/plugin.cpp:
+
2011-12-15 Alexander Færøy <[email protected]>
[Qt] Remove unnecessary methods and members from DeviceOrientationClientQt
Modified: trunk/Source/WebKit/qt/declarative/experimental/plugin.cpp (102921 => 102922)
--- trunk/Source/WebKit/qt/declarative/experimental/plugin.cpp 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit/qt/declarative/experimental/plugin.cpp 2011-12-15 12:38:42 UTC (rev 102922)
@@ -20,6 +20,7 @@
#include "qquickwebpage_p.h"
#include "qquickwebview_p.h"
#include "qwebdownloaditem_p.h"
+#include "qwebviewportinfo_p.h"
#include "qwebnavigationhistory_p.h"
@@ -49,6 +50,8 @@
qmlRegisterExtendedType<QQuickWebView, QQuickWebViewExperimentalExtension>(uri, 3, 0, "WebView");
qmlRegisterUncreatableType<QQuickWebViewExperimental>(uri, 3, 0, "QQuickWebViewExperimental",
QObject::tr("Cannot create separate instance of QQuickWebViewExperimental"));
+ qmlRegisterUncreatableType<QWebViewportInfo>(uri, 3, 0, "QWebViewportInfo",
+ QObject::tr("Cannot create separate instance of QWebViewportInfo"));
}
};
Modified: trunk/Source/WebKit2/ChangeLog (102921 => 102922)
--- trunk/Source/WebKit2/ChangeLog 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/ChangeLog 2011-12-15 12:38:42 UTC (rev 102922)
@@ -1,3 +1,45 @@
+2011-12-15 Michael Brüning <[email protected]>
+
+ [QT][WK2]Add (experimental) viewport info view to Minibrowser/qt.
+ https://bugs.webkit.org/show_bug.cgi?id=72893
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch extends QQuickWebViewExperimental by a property named
+ viewportInfo, which contains the viewport scalability and
+ layout and contents size information. This property is exposed to
+ QML through the experimental extension for QQuickWebView.
+
+ * Target.pri:
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::didChangeContentsSize):
+ (QQuickWebViewPrivate::computeViewportConstraints):
+ (QQuickWebViewPrivate::PostTransitionState::apply): Added applying
+ contentsSize to viewportInfo.
+ (QQuickWebViewExperimental::QQuickWebViewExperimental):
+ (QQuickWebViewExperimental::viewportInfo):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h: Moved PostTransitionState::apply
+ to qquickwebview.cpp. Added friend QWebViewportInfo.
+ * UIProcess/API/qt/qwebviewportinfo.cpp: Added.
+ (QWebViewportInfo::QWebViewportInfo):
+ (QWebViewportInfo::~QWebViewportInfo):
+ (QWebViewportInfo::contentsSize):
+ (QWebViewportInfo::currentScale):
+ (QWebViewportInfo::devicePixelRatio):
+ (QWebViewportInfo::initialScale):
+ (QWebViewportInfo::minimumScale):
+ (QWebViewportInfo::maximumScale):
+ (QWebViewportInfo::isScalable):
+ (QWebViewportInfo::layoutSize):
+ (QWebViewportInfo::didUpdateContentsSize):
+ (QWebViewportInfo::didUpdateCurrentScale):
+ (QWebViewportInfo::didUpdateViewportConstraints):
+ * UIProcess/API/qt/qwebviewportinfo_p.h: Added.
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (WebKit::QtViewportInteractionEngine::Constraints::Constraints): Added layoutSize.
+ (WebKit::QtViewportInteractionEngine::constraints): Added property to access m_contraints.
+
2011-12-15 Simon Hausmann <[email protected]>
[WK2] WebPage::m_useFixedLayout variable unininitialized
Modified: trunk/Source/WebKit2/Target.pri (102921 => 102922)
--- trunk/Source/WebKit2/Target.pri 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/Target.pri 2011-12-15 12:38:42 UTC (rev 102922)
@@ -184,6 +184,7 @@
UIProcess/API/qt/qwebnavigationhistory_p_p.h \
UIProcess/API/qt/qquickwebview_p.h \
UIProcess/API/qt/qquickwebview_p_p.h \
+ UIProcess/API/qt/qwebviewportinfo_p.h \
UIProcess/Authentication/AuthenticationChallengeProxy.h \
UIProcess/Authentication/AuthenticationDecisionListener.h \
UIProcess/Authentication/WebCredential.h \
@@ -504,6 +505,7 @@
UIProcess/API/qt/qwebnavigationhistory.cpp \
UIProcess/API/qt/qquickwebview.cpp \
UIProcess/API/qt/qwebpreferences.cpp \
+ UIProcess/API/qt/qwebviewportinfo.cpp \
UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
UIProcess/Authentication/AuthenticationDecisionListener.cpp \
UIProcess/Authentication/WebCredential.cpp \
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (102921 => 102922)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2011-12-15 12:38:42 UTC (rev 102922)
@@ -40,6 +40,7 @@
#include "qwebnavigationhistory_p_p.h"
#include "qwebpreferences_p.h"
#include "qwebpreferences_p_p.h"
+#include "qwebviewportinfo_p.h"
#include <_javascript_Core/InitializeThreading.h>
#include <QDeclarativeEngine>
@@ -177,6 +178,7 @@
void QQuickWebViewPrivate::didChangeContentsSize(const QSize& newSize)
{
+ Q_Q(QQuickWebView);
if (useTraditionalDesktopBehaviour)
return;
@@ -188,6 +190,8 @@
pageView->setWidth(newSize.width());
pageView->setHeight(newSize.height());
+
+ q->m_experimental->viewportInfo()->didUpdateContentsSize();
}
void QQuickWebViewPrivate::didChangeViewportProperties(const WebCore::ViewportArguments& args)
@@ -270,6 +274,7 @@
// FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended.
webPageProxy()->setFixedVisibleContentRect(alignedVisibleContentRect);
+ q->m_experimental->viewportInfo()->didUpdateCurrentScale();
}
void QQuickWebViewPrivate::_q_viewportTrajectoryVectorChanged(const QPointF& trajectoryVector)
@@ -312,6 +317,22 @@
updateVisibleContentRectAndScale();
}
+void QQuickWebViewPrivate::PostTransitionState::apply()
+{
+ p->interactionEngine->reset();
+ p->interactionEngine->applyConstraints(p->computeViewportConstraints());
+ p->interactionEngine->pagePositionRequest(position);
+
+ if (contentsSize.isValid()) {
+ p->pageView->setWidth(contentsSize.width());
+ p->pageView->setHeight(contentsSize.height());
+ p->q_ptr->experimental()->viewportInfo()->didUpdateContentsSize();
+ }
+
+ position = QPoint();
+ contentsSize = QSize();
+}
+
QtViewportInteractionEngine::Constraints QQuickWebViewPrivate::computeViewportConstraints()
{
Q_Q(QQuickWebView);
@@ -341,7 +362,10 @@
newConstraints.maximumScale = attr.maximumScale;
newConstraints.devicePixelRatio = attr.devicePixelRatio;
newConstraints.isUserScalable = !!attr.userScalable;
+ newConstraints.layoutSize = attr.layoutSize;
+ q->m_experimental->viewportInfo()->didUpdateViewportConstraints();
+
return newConstraints;
}
@@ -540,6 +564,7 @@
: QObject(webView)
, q_ptr(webView)
, d_ptr(webView->d_ptr.data())
+ , m_viewportInfo(new QWebViewportInfo(webView->d_ptr.data(), this))
{
}
@@ -644,6 +669,11 @@
d_ptr->navigationHistory->d->goBackTo(index);
}
+QWebViewportInfo* QQuickWebViewExperimental::viewportInfo()
+{
+ return m_viewportInfo;
+}
+
QQuickWebView::QQuickWebView(QQuickItem* parent)
: QQuickItem(parent)
, d_ptr(new QQuickWebViewPrivate(this))
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h (102921 => 102922)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2011-12-15 12:38:42 UTC (rev 102922)
@@ -34,6 +34,7 @@
class QWebNavigationHistory;
class QWebPreferences;
class QWebPermissionRequest;
+class QWebViewportInfo;
namespace WTR {
class PlatformWebView;
@@ -174,6 +175,7 @@
Q_PROPERTY(QDeclarativeComponent* promptDialog READ promptDialog WRITE setPromptDialog NOTIFY promptDialogChanged)
Q_PROPERTY(QDeclarativeComponent* itemSelector READ itemSelector WRITE setItemSelector NOTIFY itemSelectorChanged)
Q_PROPERTY(bool useTraditionalDesktopBehaviour READ useTraditionalDesktopBehaviour WRITE setUseTraditionalDesktopBehaviour)
+ Q_PROPERTY(QWebViewportInfo* viewportInfo READ viewportInfo CONSTANT FINAL)
public:
QQuickWebViewExperimental(QQuickWebView* webView);
@@ -187,6 +189,8 @@
void setPromptDialog(QDeclarativeComponent*);
QDeclarativeComponent* itemSelector() const;
void setItemSelector(QDeclarativeComponent*);
+
+ QWebViewportInfo* viewportInfo();
bool useTraditionalDesktopBehaviour() const;
QWebNavigationHistory* navigationHistory() const;
@@ -209,6 +213,7 @@
private:
QQuickWebView* q_ptr;
QQuickWebViewPrivate* d_ptr;
+ QWebViewportInfo* m_viewportInfo;
friend class QtWebPageProxy;
friend class QtWebPageUIClient;
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (102921 => 102922)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2011-12-15 12:38:42 UTC (rev 102922)
@@ -45,6 +45,7 @@
}
class QtWebPageProxy;
class QWebNavigationHistory;
+class QWebViewportInfo;
QT_BEGIN_NAMESPACE
class QDeclarativeComponent;
@@ -55,6 +56,7 @@
Q_DECLARE_PUBLIC(QQuickWebView)
friend class QQuickWebViewExperimental;
friend class QQuickWebPage;
+ friend class QWebViewportInfo;
public:
static QQuickWebViewPrivate* get(QQuickWebView* q) { return q->d_ptr.data(); }
@@ -122,21 +124,8 @@
: p(parent)
{ }
- void apply()
- {
- p->interactionEngine->reset();
- p->interactionEngine->applyConstraints(p->computeViewportConstraints());
- p->interactionEngine->pagePositionRequest(position);
+ void apply();
- if (contentsSize.isValid()) {
- p->pageView->setWidth(contentsSize.width());
- p->pageView->setHeight(contentsSize.height());
- }
-
- position = QPoint();
- contentsSize = QSize();
- }
-
QQuickWebViewPrivate* p;
QSize contentsSize;
QPoint position;
Added: trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp (0 => 102922)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp 2011-12-15 12:38:42 UTC (rev 102922)
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "qwebviewportinfo_p.h"
+
+#include "qquickwebview_p.h"
+#include "qquickwebview_p_p.h"
+
+QWebViewportInfo::QWebViewportInfo(QQuickWebViewPrivate* webViewPrivate, QObject* parent)
+ : QObject(parent)
+ , m_webViewPrivate(webViewPrivate)
+{
+
+}
+
+QWebViewportInfo::~QWebViewportInfo()
+{
+
+}
+
+QSize QWebViewportInfo::contentsSize() const
+{
+ return QSize(m_webViewPrivate->pageView->width(), m_webViewPrivate->pageView->height());
+}
+
+qreal QWebViewportInfo::currentScale() const
+{
+ return m_webViewPrivate->pageView->scale();
+}
+
+QVariant QWebViewportInfo::devicePixelRatio() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().devicePixelRatio;
+}
+
+QVariant QWebViewportInfo::initialScale() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().initialScale;
+}
+
+QVariant QWebViewportInfo::minimumScale() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().minimumScale;
+}
+
+QVariant QWebViewportInfo::maximumScale() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().maximumScale;
+}
+
+QVariant QWebViewportInfo::isScalable() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().isUserScalable;
+}
+
+QVariant QWebViewportInfo::layoutSize() const
+{
+ if (!m_webViewPrivate->interactionEngine)
+ return QVariant();
+
+ return m_webViewPrivate->interactionEngine->constraints().layoutSize;
+}
+
+void QWebViewportInfo::didUpdateContentsSize()
+{
+ emit contentsSizeUpdated();
+}
+
+void QWebViewportInfo::didUpdateCurrentScale()
+{
+ emit currentScaleUpdated();
+}
+
+void QWebViewportInfo::didUpdateViewportConstraints()
+{
+ emit viewportConstraintsUpdated();
+}
Added: trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h (0 => 102922)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h 2011-12-15 12:38:42 UTC (rev 102922)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef qwebviewportinfp_p_h
+#define qwebviewportinfo_p_h
+
+#include "qwebkitglobal.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QPointer>
+#include <QtCore/QSize>
+#include <QtCore/QVariant>
+#include <QtDeclarative/QtDeclarative>
+
+namespace WebCore {
+class ViewportAttributes;
+}
+class QQuickWebViewPrivate;
+
+class QWEBKIT_EXPORT QWebViewportInfo : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeUpdated)
+ Q_PROPERTY(qreal currentScale READ currentScale NOTIFY currentScaleUpdated)
+ Q_PROPERTY(QVariant devicePixelRatio READ devicePixelRatio NOTIFY viewportConstraintsUpdated)
+ Q_PROPERTY(QVariant initialScale READ initialScale NOTIFY viewportConstraintsUpdated)
+ Q_PROPERTY(QVariant isScalable READ isScalable NOTIFY viewportConstraintsUpdated)
+ Q_PROPERTY(QVariant maximumScale READ maximumScale NOTIFY viewportConstraintsUpdated)
+ Q_PROPERTY(QVariant minimumScale READ minimumScale NOTIFY viewportConstraintsUpdated)
+ Q_PROPERTY(QVariant layoutSize READ layoutSize NOTIFY viewportConstraintsUpdated)
+
+signals:
+ void contentsSizeUpdated();
+ void currentScaleUpdated();
+ void viewportConstraintsUpdated();
+
+public:
+ QWebViewportInfo(QQuickWebViewPrivate* webviewPrivate, QObject* parent = 0);
+ virtual ~QWebViewportInfo();
+
+ QSize contentsSize() const;
+ qreal currentScale() const;
+ QVariant devicePixelRatio() const;
+ QVariant initialScale() const;
+ QVariant isScalable() const;
+ QVariant layoutSize() const;
+ QVariant maximumScale() const;
+ QVariant minimumScale() const;
+
+ void didUpdateContentsSize();
+ void didUpdateCurrentScale();
+ void didUpdateViewportConstraints();
+
+private:
+ QQuickWebViewPrivate* m_webViewPrivate;
+};
+
+#endif // qwebviewportinfo_p
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (102921 => 102922)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2011-12-15 12:38:42 UTC (rev 102922)
@@ -54,6 +54,7 @@
, maximumScale(1.8)
, devicePixelRatio(1.0)
, isUserScalable(true)
+ , layoutSize(QSize())
{ }
qreal initialScale;
@@ -61,6 +62,7 @@
qreal maximumScale;
qreal devicePixelRatio;
bool isUserScalable;
+ QSize layoutSize;
};
bool event(QEvent*);
@@ -94,6 +96,7 @@
void zoomToAreaGestureEnded(const QPointF& touchPoint, const QRectF& targetArea);
void focusEditableArea(const QRectF& caretArea, const QRectF& targetArea);
+ const Constraints& constraints() const { return m_constraints; }
Q_SIGNALS:
void contentSuspendRequested();
void contentResumeRequested();
Modified: trunk/Source/qtwebkit-export.map (102921 => 102922)
--- trunk/Source/qtwebkit-export.map 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Source/qtwebkit-export.map 2011-12-15 12:38:42 UTC (rev 102922)
@@ -130,6 +130,9 @@
*QWebDownloadItem;
non-virtual?thunk?to?QWebDownloadItem*;
QWebDownloadItem::*;
+ *QWebViewportInfo;
+ non-virtual?thunk?to?QWebViewportInfo;
+ QWebViewportInfo::*;
*QQuickWebPage;
non-virtual?thunk?to?QQuickWebPage*;
QQuickWebPage::*;
Modified: trunk/Tools/ChangeLog (102921 => 102922)
--- trunk/Tools/ChangeLog 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Tools/ChangeLog 2011-12-15 12:38:42 UTC (rev 102922)
@@ -1,3 +1,21 @@
+2011-12-15 Michael Brüning <[email protected]>
+
+ [QT][WK2]Add (experimental) viewport info view to Minibrowser/qt.
+ https://bugs.webkit.org/show_bug.cgi?id=72893
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch extends QQuickWebViewExperimental by a property named
+ viewportInfo, which contains the viewport scalability and
+ layout and contents size information. This property is exposed to
+ QML through the experimental extension for QQuickWebView.
+
+ * MiniBrowser/qt/MiniBrowser.pro:
+ * MiniBrowser/qt/MiniBrowser.qrc:
+ * MiniBrowser/qt/icons/info.png: Added.
+ * MiniBrowser/qt/qml/BrowserWindow.qml:
+ * MiniBrowser/qt/qml/ViewportInfoItem.qml: Added.
+
2011-12-15 Shinya Kawanaka <[email protected]>
[chromium] WebViewHost::requestCheckingOfText should return immediately if text is empty.
Modified: trunk/Tools/MiniBrowser/qt/MiniBrowser.pro (102921 => 102922)
--- trunk/Tools/MiniBrowser/qt/MiniBrowser.pro 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowser.pro 2011-12-15 12:38:42 UTC (rev 102922)
@@ -31,4 +31,5 @@
OTHER_FILES += \
qml/BrowserWindow.qml \
- qml/ItemSelector.qml
+ qml/ItemSelector.qml \
+ qml/ViewportInfoItem.qml
Modified: trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc (102921 => 102922)
--- trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowser.qrc 2011-12-15 12:38:42 UTC (rev 102922)
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
+ <file>icons/info.png</file>
<file>icons/next.png</file>
<file>icons/previous.png</file>
<file>icons/refresh.png</file>
@@ -8,6 +9,7 @@
<file>qml/BrowserWindow.qml</file>
<file>qml/ItemSelector.qml</file>
<file>qml/MockTouchPoint.qml</file>
+ <file>qml/ViewportInfoItem.qml</file>
<file>useragentlist.txt</file>
</qresource>
</RCC>
Added: trunk/Tools/MiniBrowser/qt/icons/info.png (0 => 102922)
--- trunk/Tools/MiniBrowser/qt/icons/info.png (rev 0)
+++ trunk/Tools/MiniBrowser/qt/icons/info.png 2011-12-15 12:38:42 UTC (rev 102922)
@@ -0,0 +1,7 @@
+\x89PNG
+
+
+IHDR Ĵl; sRGB \xAE\xCE\xE9 bKGD \xFF \xFF \xFF\xA0\xBD\xA7\x93 pHYs \x9A\x9C tIME\xDB\xF7K\xA2\xA5 \xD4IDAT8\xCB\xEDԽJA\xE0\xCF5\xA5`!U\xEA\x90Z\xC6\xC2\xCE'H\xB5M\xFA% \xBE\xCDV\xC1r\xB5
+vby\xF5 R\x84\xB5\x99*\x84\xFD!Z(9p\xB9\xCC\xCF9s8p\x87#~'u\x87!+nq\x89s<\xE1\xCFe\x9EVu\xDC^\xC3\xC3˝\xF54\xD6
+^\xEA\x88I\x83\xF0&\xB8\xC0\x8FqvP{\xA2\xE0\x9Fe\x9E\xF6q\xBC\x8Bq싦\x8BI\xB7C̱\xC6ݏD#x\xC5\xD7e\x9E~5qz-
+\xDFc\x88\xAB6\xA2]\xA2\xB1\xAF\xDAF\xD7V\xF8\xCA<\xDD\xFE\x8D\xB9YQ\x85\xAC\xA8\xBApG\xFCϏ>\xA2'\xF4\xB6\xB1>\xEAH\xDFv+0f- IEND\xAEB`\x82
\ No newline at end of file
Modified: trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml (102921 => 102922)
--- trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml 2011-12-15 12:35:27 UTC (rev 102921)
+++ trunk/Tools/MiniBrowser/qt/qml/BrowserWindow.qml 2011-12-15 12:38:42 UTC (rev 102922)
@@ -160,6 +160,25 @@
}
}
}
+
+ Rectangle {
+ id: viewportInfoButton
+ height: navigationBar.height - 2
+ width: height
+ color: "#efefef"
+
+ Image {
+ anchors.centerIn: parent
+ source: "../icons/info.png"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ viewportInfoItem.visible = !viewportInfoItem.visible
+ }
+ }
+ }
}
Rectangle {
color: "white"
@@ -235,6 +254,18 @@
experimental.itemSelector: ItemSelector { }
}
+ ViewportInfoItem {
+ id: viewportInfoItem
+ anchors {
+ top: navigationBar.bottom
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ visible: false
+ viewportInfo : webView.experimental.viewportInfo
+ }
+
Keys.onPressed: {
if (((event.modifiers & Qt.ControlModifier) && event.key == Qt.Key_L) || event.key == Qt.key_F6) {
focusAddressBar()
Added: trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml (0 => 102922)
--- trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml (rev 0)
+++ trunk/Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml 2011-12-15 12:38:42 UTC (rev 102922)
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import QtWebKit 3.0
+
+Rectangle {
+ property var viewportInfo
+
+ color: "black"
+ opacity: 0.8
+
+ Text {
+ id: viewportInfoLabel
+ text: "Viewport Info"
+ color: "white"
+ }
+ Text {
+ id: currentScaleLabel
+ anchors.top: viewportInfoLabel.bottom
+ text: "Current scale: " + viewportInfo.currentScale
+ color: "white"
+ }
+ Text {
+ id: initialScaleLabel
+ anchors.top: currentScaleLabel.bottom
+ text: "Initial scale: " + viewportInfo.initialScale
+ color: "white"
+ }
+ Text {
+ id: minimumScaleLabel
+ anchors.top: initialScaleLabel.bottom
+ text: "Minimum scale: " + viewportInfo.minimumScale
+ color: "white"
+ }
+ Text {
+ id: maximumScaleLabel
+ anchors.top: minimumScaleLabel.bottom
+ text: "Maximum scale: " + viewportInfo.maximumScale
+ color: "white"
+ }
+ Text {
+ id: devicePixelRatioLabel
+ anchors.top: maximumScaleLabel.bottom
+ text: "Device pixel ration: " + viewportInfo.devicePixelRatio
+ color: "white"
+ }
+ Text {
+ id: contentsSizeLabel
+ anchors.top: devicePixelRatioLabel.bottom
+ text: "Contents size: (" + viewportInfo.contentsSize.width + "x" + viewportInfo.contentsSize.height + ")"
+ color: "white"
+ }
+ Text {
+ id: layoutSizeLabel
+ anchors.top: contentsSizeLabel.bottom
+ text: "Viewport layout size: (" + viewportInfo.layoutSize.width + "x" + viewportInfo.layoutSize.height + ")"
+ color: "white"
+ }
+ Text {
+ id: scalableLabel
+ anchors.top: layoutSizeLabel.bottom
+ text: "View " + (viewportInfo.isScalable ? "is " : "is not " ) + "scalable."
+ color: "white"
+ }
+}