Title: [111521] trunk/Source/WebKit2
- Revision
- 111521
- Author
- [email protected]
- Date
- 2012-03-21 04:26:03 -0700 (Wed, 21 Mar 2012)
Log Message
[Qt] Remove the PostTransitionState
https://bugs.webkit.org/show_bug.cgi?id=81751
Reviewed by Simon Hausmann.
As we are handling content size change event etc from the
WebProcess, that conflicts with the PostTransitionState handling
and we therefore need to handle this slightly differently.
Remove the code and make sure that we never resize the tiled
area to something smaller than the layout viewport.
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
(QQuickWebViewFlickablePrivate::loadDidCommit):
(QQuickWebViewFlickablePrivate::didFinishFirstNonEmptyLayout):
(QQuickWebViewFlickablePrivate::didChangeViewportProperties):
(QQuickWebViewFlickablePrivate::_q_resume):
(QQuickWebViewFlickablePrivate::pageDidRequestScroll):
(QQuickWebViewFlickablePrivate::didChangeContentsSize):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewFlickablePrivate):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::applyConstraints):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::resizeToContentsIfNeeded):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (111520 => 111521)
--- trunk/Source/WebKit2/ChangeLog 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-21 11:26:03 UTC (rev 111521)
@@ -1,3 +1,34 @@
+2012-03-21 Kenneth Rohde Christiansen <[email protected]>
+
+ [Qt] Remove the PostTransitionState
+ https://bugs.webkit.org/show_bug.cgi?id=81751
+
+ Reviewed by Simon Hausmann.
+
+ As we are handling content size change event etc from the
+ WebProcess, that conflicts with the PostTransitionState handling
+ and we therefore need to handle this slightly differently.
+
+ Remove the code and make sure that we never resize the tiled
+ area to something smaller than the layout viewport.
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
+ (QQuickWebViewFlickablePrivate::loadDidCommit):
+ (QQuickWebViewFlickablePrivate::didFinishFirstNonEmptyLayout):
+ (QQuickWebViewFlickablePrivate::didChangeViewportProperties):
+ (QQuickWebViewFlickablePrivate::_q_resume):
+ (QQuickWebViewFlickablePrivate::pageDidRequestScroll):
+ (QQuickWebViewFlickablePrivate::didChangeContentsSize):
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewFlickablePrivate):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::applyConstraints):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::contentsSizeChanged):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::resizeToContentsIfNeeded):
+
2012-03-21 Carlos Garcia Campos <[email protected]>
[GTK] Add webkit_web_view_run_javascript() to WebKit2 GTK+
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (111520 => 111521)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-03-21 11:26:03 UTC (rev 111521)
@@ -489,8 +489,6 @@
QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate(QQuickWebView* viewport)
: QQuickWebViewPrivate(viewport)
- , postTransitionState(adoptPtr(new PostTransitionState(this)))
- , isTransitioningToNewPage(false)
, pageIsSuspended(true)
, loadSuccessDispatchIsPending(false)
{
@@ -581,25 +579,17 @@
{
// Due to entering provisional load before committing, we
// might actually be suspended here.
-
- isTransitioningToNewPage = true;
}
void QQuickWebViewFlickablePrivate::didFinishFirstNonEmptyLayout()
{
- if (!pageIsSuspended) {
- isTransitioningToNewPage = false;
- postTransitionState->apply();
- }
}
void QQuickWebViewFlickablePrivate::didChangeViewportProperties(const WebCore::ViewportArguments& args)
{
viewportArguments = args;
- if (isTransitioningToNewPage)
- return;
-
+ // FIXME: If suspended we should do this on resume.
interactionEngine->applyConstraints(computeViewportConstraints());
}
@@ -652,33 +642,17 @@
pageIsSuspended = false;
webPageProxy->resumeActiveDOMObjectsAndAnimations();
- if (isTransitioningToNewPage) {
- isTransitioningToNewPage = false;
- postTransitionState->apply();
- }
-
_q_contentViewportChanged(QPointF());
}
void QQuickWebViewFlickablePrivate::pageDidRequestScroll(const QPoint& pos)
{
- if (isTransitioningToNewPage) {
- postTransitionState->position = pos;
- return;
- }
-
interactionEngine->pagePositionRequest(pos);
}
void QQuickWebViewFlickablePrivate::didChangeContentsSize(const QSize& newSize)
{
Q_Q(QQuickWebView);
- // FIXME: We probably want to handle suspend here as well
- if (isTransitioningToNewPage) {
- postTransitionState->contentsSize = newSize;
- return;
- }
-
pageView->setContentsSize(newSize);
q->experimental()->viewportInfo()->didUpdateContentsSize();
}
@@ -720,21 +694,6 @@
return newConstraints;
}
-void QQuickWebViewFlickablePrivate::PostTransitionState::apply()
-{
- p->interactionEngine->reset();
- p->interactionEngine->applyConstraints(p->computeViewportConstraints());
- p->interactionEngine->pagePositionRequest(position);
-
- if (contentsSize.isValid()) {
- p->pageView->setContentsSize(contentsSize);
- p->q_ptr->experimental()->viewportInfo()->didUpdateContentsSize();
- }
-
- position = QPoint();
- contentsSize = QSize();
-}
-
/*!
\qmlsignal WebView::onNavigationRequested(request)
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (111520 => 111521)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-03-21 11:26:03 UTC (rev 111521)
@@ -204,25 +204,7 @@
QtViewportInteractionEngine::Constraints computeViewportConstraints();
private:
- // This class is responsible for collecting and applying all properties
- // on the viewport item, when transitioning from page A to page B is finished.
- // See more at https://trac.webkit.org/wiki/QtWebKitLayoutInteraction
- class PostTransitionState {
- public:
- PostTransitionState(QQuickWebViewFlickablePrivate* parent)
- : p(parent)
- { }
-
- void apply();
-
- QQuickWebViewFlickablePrivate* p;
- QSize contentsSize;
- QPoint position;
- };
-
QScopedPointer<QtViewportInteractionEngine> interactionEngine;
- OwnPtr<PostTransitionState> postTransitionState;
- bool isTransitioningToNewPage;
bool pageIsSuspended;
bool loadSuccessDispatchIsPending;
};
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (111520 => 111521)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-03-21 11:26:03 UTC (rev 111521)
@@ -418,6 +418,8 @@
// We always have to apply the constrains even if they didn't change, as
// the initial scale might need to be applied.
+ reset();
+
ViewportUpdateDeferrer guard(this);
m_constraints = constraints;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (111520 => 111521)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2012-03-21 11:26:03 UTC (rev 111521)
@@ -438,10 +438,13 @@
return;
#if PLATFORM(QT)
- m_page->send(Messages::WebPageProxy::DidChangeContentsSize(size));
+ if (m_page->useFixedLayout()) {
+ // The below method updates the size().
+ m_page->resizeToContentsIfNeeded();
+ }
- if (m_page->useFixedLayout())
- m_page->resizeToContentsIfNeeded();
+ m_page->send(Messages::WebPageProxy::DidChangeContentsSize(m_page->size()));
+
#endif
FrameView* frameView = frame->view();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (111520 => 111521)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-03-21 11:21:24 UTC (rev 111520)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-03-21 11:26:03 UTC (rev 111521)
@@ -852,7 +852,7 @@
if (contentSize == m_viewSize)
return;
- m_viewSize = contentSize;
+ m_viewSize = contentSize.expandedTo(view->fixedLayoutSize());
view->resize(m_viewSize);
view->setNeedsLayout();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes