Title: [117952] trunk/Source/WebKit2
Revision
117952
Author
[email protected]
Date
2012-05-22 04:54:17 -0700 (Tue, 22 May 2012)

Log Message

[Qt] Mini clean ups in the interaction engine
https://bugs.webkit.org/show_bug.cgi?id=87013

Reviewed by Simon Hausmann.

* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::animateItemRectVisible):
    Assert that we are suspended.
(WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
    Never zoom to any area if suspended which indicates other
    animation or user interaction.
(WebKit::QtViewportInteractionEngine::ensureContentWithinViewportBoundary):
    If immediate is set, ignore suspension.
(WebKit::QtViewportInteractionEngine::itemSizeChanged):
    Improve the comment.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (117951 => 117952)


--- trunk/Source/WebKit2/ChangeLog	2012-05-22 11:44:54 UTC (rev 117951)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-22 11:54:17 UTC (rev 117952)
@@ -1,3 +1,21 @@
+2012-05-21  Kenneth Rohde Christiansen  <[email protected]>
+
+        [Qt] Mini clean ups in the interaction engine
+        https://bugs.webkit.org/show_bug.cgi?id=87013
+
+        Reviewed by Simon Hausmann.
+
+        * UIProcess/qt/QtViewportInteractionEngine.cpp:
+        (WebKit::QtViewportInteractionEngine::animateItemRectVisible):
+            Assert that we are suspended.
+        (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
+            Never zoom to any area if suspended which indicates other
+            animation or user interaction.
+        (WebKit::QtViewportInteractionEngine::ensureContentWithinViewportBoundary):
+            If immediate is set, ignore suspension.
+        (WebKit::QtViewportInteractionEngine::itemSizeChanged):
+            Improve the comment.
+
 2012-05-22  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] Tap-to-zoom overshoot animation

Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (117951 => 117952)


--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2012-05-22 11:44:54 UTC (rev 117951)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2012-05-22 11:54:17 UTC (rev 117952)
@@ -194,6 +194,8 @@
 
 bool QtViewportInteractionEngine::animateItemRectVisible(const QRectF& itemRect)
 {
+    ASSERT(m_suspended);
+
     QRectF currentItemRectVisible = m_viewport->mapRectToWebContent(m_viewport->boundingRect());
     if (itemRect == currentItemRectVisible)
         return false;
@@ -347,7 +349,7 @@
     if (!targetArea.isValid())
         return;
 
-    if (scrollAnimationActive() || scaleAnimationActive())
+    if (m_suspendCount)
         return;
 
     m_hadUserInteraction = true;
@@ -427,7 +429,7 @@
 
 bool QtViewportInteractionEngine::ensureContentWithinViewportBoundary(bool immediate)
 {
-    if (scrollAnimationActive() || scaleAnimationActive())
+    if (!immediate && (scrollAnimationActive() || scaleAnimationActive()))
         return false;
 
     qreal endItemScale = itemScaleFromCSS(innerBoundedCSSScale(currentCSSScale()));
@@ -617,9 +619,14 @@
     m_scaleUpdateDeferrer.clear();
 }
 
+/*
+ * This is called for all changes of item scale, width or height.
+ * This is called when interacting, ie. during for instance pinch-zooming.
+ *
+ * FIXME: This is currently called twice if you concurrently change width and height.
+ */
 void QtViewportInteractionEngine::itemSizeChanged()
 {
-    // FIXME: This needs to be done smarter. What happens if it resizes when we were interacting?
     if (m_suspendCount)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to