Diff
Modified: trunk/Source/WebKit2/ChangeLog (99057 => 99058)
--- trunk/Source/WebKit2/ChangeLog 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/ChangeLog 2011-11-02 14:24:31 UTC (rev 99058)
@@ -1,3 +1,28 @@
+2011-11-02 Zalan Bujtas <[email protected]>
+
+ [Qt][WK2] Move content to resize (setResizesToContentsUsingLayoutSize) from UI process to Web process
+ https://bugs.webkit.org/show_bug.cgi?id=71107
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Reduce the number of IPC calls to WebProcess by moving the content to resize
+ calls from UI process to Web process.
+
+ * UIProcess/API/qt/qtouchwebview.cpp:
+ (QTouchWebViewPrivate::updateViewportSize):
+ (QTouchWebViewPrivate::updateViewportConstraints):
+ (QTouchWebView::geometryChanged):
+ * UIProcess/API/qt/qtouchwebview_p.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setViewportSize):
+ (WebKit::WebPageProxy::preferencesDidChange):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/qt/QtTouchWebPageProxy.cpp:
+ * UIProcess/qt/QtTouchWebPageProxy.h:
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
+ * WebProcess/WebPage/WebPage.messages.in:
+
2011-10-18 Dinu Jacob <[email protected]>
[Qt][WK2]: Shouldn't send unhandled TouchCancel event to gesture recognizers
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp 2011-11-02 14:24:31 UTC (rev 99058)
@@ -59,6 +59,17 @@
touchPageProxy()->setVisibleContentRectTrajectoryVector(trajectoryVector);
}
+void QTouchWebViewPrivate::updateViewportSize()
+{
+ Q_Q(QTouchWebView);
+ WebPageProxy* wkPage = toImpl(pageProxy->pageRef());
+ // Let the WebProcess know about the new viewport size, so that
+ // it can resize the content accordingly.
+ wkPage->setViewportSize(q->boundingRect().size().toSize());
+ updateViewportConstraints();
+ _q_viewportUpdated();
+}
+
void QTouchWebViewPrivate::updateViewportConstraints()
{
Q_Q(QTouchWebView);
@@ -88,9 +99,6 @@
// Overwrite minimum scale value with fit-to-view value, unless the the content author
// explicitly says no. NB: We can only do this when we know we have a valid size, ie.
// after initial layout has completed.
-
- // FIXME: Do this on the web process side.
- wkPage->setResizesToContentsUsingLayoutSize(attr.layoutSize);
}
void QTouchWebViewPrivate::didChangeViewportProperties(const WebCore::ViewportArguments& args)
@@ -122,10 +130,8 @@
{
Q_D(QTouchWebView);
QQuickItem::geometryChanged(newGeometry, oldGeometry);
- if (newGeometry.size() != oldGeometry.size()) {
- d->updateViewportConstraints();
- d->_q_viewportUpdated();
- }
+ if (newGeometry.size() != oldGeometry.size())
+ d->updateViewportSize();
}
void QTouchWebView::touchEvent(QTouchEvent* event)
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview_p.h (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview_p.h 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview_p.h 2011-11-02 14:24:31 UTC (rev 99058)
@@ -39,6 +39,7 @@
void loadDidCommit();
void _q_viewportUpdated();
void _q_viewportTrajectoryVectorChanged(const QPointF&);
+ void updateViewportSize();
void updateViewportConstraints();
QtTouchWebPageProxy* touchPageProxy() { return static_cast<QtTouchWebPageProxy*>(QBaseWebViewPrivate::pageProxy.data()); }
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-11-02 14:24:31 UTC (rev 99058)
@@ -802,6 +802,14 @@
process()->send(Messages::WebPage::SetFixedVisibleContentRect(rect), m_pageID);
}
+
+void WebPageProxy::setViewportSize(const IntSize& size)
+{
+ if (!isValid())
+ return;
+
+ process()->send(Messages::WebPage::SetViewportSize(size), m_pageID);
+}
#endif
void WebPageProxy::dragEntered(DragData* dragData, const String& dragStorageName)
@@ -1438,13 +1446,6 @@
process()->send(Messages::WebPage::PreferencesDidChange(pageGroup()->preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
-#if USE(TILED_BACKING_STORE)
-void WebPageProxy::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSize)
-{
- process()->send(Messages::WebPage::SetResizesToContentsUsingLayoutSize(targetLayoutSize), m_pageID);
-}
-#endif
-
void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-11-02 14:24:31 UTC (rev 99058)
@@ -346,6 +346,7 @@
#endif
#if USE(TILED_BACKING_STORE)
void setFixedVisibleContentRect(const WebCore::IntRect&);
+ void setViewportSize(const WebCore::IntSize&);
#endif
void handleMouseEvent(const NativeWebMouseEvent&);
@@ -509,10 +510,6 @@
void preferencesDidChange();
-#if USE(TILED_BACKING_STORE)
- void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
-#endif
-
// Called by the WebContextMenuProxy.
void contextMenuItemSelected(const WebContextMenuItemData&);
Modified: trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.cpp (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.cpp 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.cpp 2011-11-02 14:24:31 UTC (rev 99058)
@@ -102,11 +102,6 @@
m_webPageProxy->drawingArea()->setVisibleContentRectTrajectoryVector(trajectoryVector);
}
-void QtTouchWebPageProxy::setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize)
-{
- m_webPageProxy->setResizesToContentsUsingLayoutSize(targetLayoutSize);
-}
-
void QtTouchWebPageProxy::touchEvent(QTouchEvent* event)
{
#if ENABLE(TOUCH_EVENTS)
Modified: trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.h (99057 => 99058)
--- trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.h 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/UIProcess/qt/QtTouchWebPageProxy.h 2011-11-02 14:24:31 UTC (rev 99058)
@@ -43,7 +43,6 @@
void setVisibleContentRectAndScale(const QRectF&, float);
void setVisibleContentRectTrajectoryVector(const QPointF&);
- void setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize);
void findZoomableAreaForPoint(const QPoint&);
void renderNextFrame();
void renderToCurrentGLContext(const WebCore::TransformationMatrix&, float);
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (99057 => 99058)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2011-11-02 14:24:31 UTC (rev 99058)
@@ -58,6 +58,7 @@
#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
#include <WebCore/SecurityOrigin.h>
+#include <WebCore/Settings.h>
using namespace WebCore;
using namespace HTMLNames;
@@ -743,6 +744,18 @@
void WebChromeClient::dispatchViewportPropertiesDidChange(const ViewportArguments& args) const
{
m_page->send(Messages::WebPageProxy::DidChangeViewportProperties(args));
+
+#if USE(TILED_BACKING_STORE)
+ // When viewport properties change, recalculate and set the new recommended layout size in case of fixed layout rendering.
+ if (m_page->mainFrameView() && m_page->mainFrameView()->useFixedLayout()) {
+ Page* page = m_page->corePage();
+ Settings* settings = page->settings();
+
+ IntSize targetLayoutSize = computeViewportAttributes(page->viewportArguments(), settings->layoutFallbackWidth(), settings->deviceWidth(), settings->deviceHeight(),
+ settings->deviceDPI(), m_page->viewportSize()).layoutSize;
+ m_page->setResizesToContentsUsingLayoutSize(targetLayoutSize);
+ }
+#endif
}
void WebChromeClient::didStartRubberBandForFrame(Frame*, const IntSize&) const
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (99057 => 99058)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2011-11-02 14:21:37 UTC (rev 99057)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2011-11-02 14:24:31 UTC (rev 99058)
@@ -98,7 +98,6 @@
#if USE(TILED_BACKING_STORE)
SetFixedVisibleContentRect(WebCore::IntRect rect)
- SetResizesToContentsUsingLayoutSize(WebCore::IntSize size)
SetViewportSize(WebCore::IntSize size)
#endif