Diff
Modified: trunk/Source/WebKit2/ChangeLog (119219 => 119220)
--- trunk/Source/WebKit2/ChangeLog 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/ChangeLog 2012-06-01 12:32:13 UTC (rev 119220)
@@ -1,3 +1,28 @@
+2012-06-01 Kenneth Rohde Christiansen <[email protected]>
+
+ [Qt] Move suspension to QtViewportInteractionEngine
+ https://bugs.webkit.org/show_bug.cgi?id=88078
+
+ Reviewed by Simon Hausmann.
+
+ Next step is to take care of visibility changes.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
+ (QQuickWebViewFlickablePrivate::onComponentComplete):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ (QQuickWebViewFlickablePrivate):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::ViewportUpdateDeferrer::ViewportUpdateDeferrer):
+ (WebKit::ViewportUpdateDeferrer::~ViewportUpdateDeferrer):
+ (WebKit::QtViewportInteractionEngine::suspendPageContent):
+ (WebKit):
+ (WebKit::QtViewportInteractionEngine::resumePageContent):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+
2012-06-01 Dinu Jacob <[email protected]>
[Qt][W2] Qml Error in ViewportInfoItem.qml in MiniBrowser
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (119219 => 119220)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-06-01 12:32:13 UTC (rev 119220)
@@ -809,7 +809,6 @@
QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate(QQuickWebView* viewport)
: QQuickWebViewPrivate(viewport)
- , pageIsSuspended(false)
{
// Disable mouse events on the flickable web view so we do not
// select text during pan gestures on platforms which send both
@@ -838,11 +837,6 @@
interactionEngine.reset(new QtViewportInteractionEngine(webPageProxy.get(), q, pageView.data()));
pageView->eventHandler()->setViewportInteractionEngine(interactionEngine.data());
- QObject::connect(interactionEngine.data(), SIGNAL(contentSuspendRequested()), q, SLOT(_q_suspend()));
- QObject::connect(interactionEngine.data(), SIGNAL(contentResumeRequested()), q, SLOT(_q_resume()));
-
- _q_resume();
-
// Trigger setting of correct visibility flags after everything was allocated and initialized.
_q_onVisibleChanged();
}
@@ -860,21 +854,6 @@
interactionEngine->viewportItemSizeChanged();
}
-void QQuickWebViewFlickablePrivate::_q_suspend()
-{
- pageIsSuspended = true;
- webPageProxy->suspendActiveDOMObjectsAndAnimations();
-}
-
-void QQuickWebViewFlickablePrivate::_q_resume()
-{
- if (!interactionEngine)
- return;
-
- pageIsSuspended = false;
- webPageProxy->resumeActiveDOMObjectsAndAnimations();
-}
-
void QQuickWebViewFlickablePrivate::pageDidRequestScroll(const QPoint& pos)
{
interactionEngine->pageContentPositionRequested(pos);
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h (119219 => 119220)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2012-06-01 12:32:13 UTC (rev 119220)
@@ -205,9 +205,6 @@
void emitUrlChangeIfNeeded();
- Q_PRIVATE_SLOT(d_func(), void _q_suspend());
- Q_PRIVATE_SLOT(d_func(), void _q_resume());
-
Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged());
Q_PRIVATE_SLOT(d_func(), void _q_onUrlChanged());
Q_PRIVATE_SLOT(d_func(), void _q_onReceivedResponseFromDownload(QWebDownloadItem*));
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (119219 => 119220)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-06-01 12:32:13 UTC (rev 119220)
@@ -93,9 +93,6 @@
virtual void updateViewportSize() { }
void updateTouchViewportSize();
- virtual void _q_suspend() { }
- virtual void _q_resume() { }
-
virtual qreal zoomFactor() const { return 1; }
virtual void setZoomFactor(qreal) { }
@@ -228,15 +225,11 @@
virtual WebKit::QtViewportInteractionEngine* viewportInteractionEngine() { return interactionEngine.data(); }
virtual void updateViewportSize();
- virtual void _q_suspend();
- virtual void _q_resume();
-
virtual void pageDidRequestScroll(const QPoint& pos);
virtual void didChangeContentsSize(const QSize& newSize);
private:
QScopedPointer<WebKit::QtViewportInteractionEngine> interactionEngine;
- bool pageIsSuspended;
};
#endif // qquickwebview_p_p_h
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (119219 => 119220)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-06-01 12:32:13 UTC (rev 119220)
@@ -72,10 +72,8 @@
// There is no need to suspend content for immediate updates
// only during animations or longer gestures.
- if (suspendContentFlag == DeferUpdateAndSuspendContent && !engine->m_hasSuspendedContent) {
- engine->m_hasSuspendedContent = true;
- emit engine->contentSuspendRequested();
- }
+ if (suspendContentFlag == DeferUpdateAndSuspendContent)
+ engine->suspendPageContent();
}
~ViewportUpdateDeferrer()
@@ -83,10 +81,7 @@
if (--(engine->m_suspendCount))
return;
- if (engine->m_hasSuspendedContent) {
- engine->m_hasSuspendedContent = false;
- emit engine->contentResumeRequested();
- }
+ engine->resumePageContent();
// Make sure that tiles all around the viewport will be requested.
engine->informVisibleContentChange(QPointF());
@@ -96,6 +91,23 @@
QtViewportInteractionEngine* const engine;
};
+void QtViewportInteractionEngine::suspendPageContent()
+{
+ if (m_hasSuspendedContent)
+ return;
+
+ m_hasSuspendedContent = true;
+ m_webPageProxy->suspendActiveDOMObjectsAndAnimations();
+}
+
+void QtViewportInteractionEngine::resumePageContent()
+{
+ if (!m_hasSuspendedContent)
+ return;
+ m_hasSuspendedContent = false;
+ m_webPageProxy->resumeActiveDOMObjectsAndAnimations();
+}
+
// A floating point compare with absolute error.
static inline bool fuzzyCompare(qreal a, qreal b, qreal epsilon)
{
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (119219 => 119220)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-06-01 12:30:09 UTC (rev 119219)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-06-01 12:32:13 UTC (rev 119220)
@@ -92,10 +92,6 @@
void flickMoveStarted(); // Called when panning starts.
void flickMoveEnded(); // Called when panning (+ kinetic animation) ends.
-Q_SIGNALS:
- void contentSuspendRequested();
- void contentResumeRequested();
-
private:
friend class ViewportUpdateDeferrer;
friend class ::QWebKitTest;
@@ -124,6 +120,9 @@
QRectF computePosRangeForPageItemAtScale(qreal itemScale) const;
void scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale);
+ void suspendPageContent();
+ void resumePageContent();
+
WebCore::ViewportAttributes m_rawAttributes;
bool m_allowsUserScaling;