Title: [111015] trunk/Source/WebKit2
- Revision
- 111015
- Author
- abe...@webkit.org
- Date
- 2012-03-16 09:43:31 -0700 (Fri, 16 Mar 2012)
Log Message
[Qt][WK2] Fix bounce-back behaviour for panning
https://bugs.webkit.org/show_bug.cgi?id=81144
Reviewed by Kenneth Rohde Christiansen.
If the pan gesture recognizer receives a touch begin event
during an ongoing kinetic scroll animation of a previous
pan gesture, the animation is stopped and the content is
immediately positioned back to valid boundaries.
* UIProcess/qt/QtPanGestureRecognizer.cpp:
(WebKit::QtPanGestureRecognizer::recognize):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::cancelScrollAnimation):
(WebKit):
* UIProcess/qt/QtViewportInteractionEngine.h:
(QtViewportInteractionEngine):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (111014 => 111015)
--- trunk/Source/WebKit2/ChangeLog 2012-03-16 16:40:54 UTC (rev 111014)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-16 16:43:31 UTC (rev 111015)
@@ -1,3 +1,23 @@
+2012-03-16 Andras Becsi <andras.be...@nokia.com>
+
+ [Qt][WK2] Fix bounce-back behaviour for panning
+ https://bugs.webkit.org/show_bug.cgi?id=81144
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ If the pan gesture recognizer receives a touch begin event
+ during an ongoing kinetic scroll animation of a previous
+ pan gesture, the animation is stopped and the content is
+ immediately positioned back to valid boundaries.
+
+ * UIProcess/qt/QtPanGestureRecognizer.cpp:
+ (WebKit::QtPanGestureRecognizer::recognize):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::cancelScrollAnimation):
+ (WebKit):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+
2012-03-16 Dinu Jacob <dinu.ja...@nokia.com>
[Qt][Wk2] Assertion Failure and crash on file upload
Modified: trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp (111014 => 111015)
--- trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp 2012-03-16 16:40:54 UTC (rev 111014)
+++ trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp 2012-03-16 16:43:31 UTC (rev 111015)
@@ -63,10 +63,7 @@
m_state = GestureRecognitionStarted;
m_firstPosition = touchPoint.screenPos();
m_touchBegin.reset(new QTouchEvent(*event));
-
- // Touch begin while bouncing back from panning should move the content to the end position immediately.
- interactionEngine()->panGestureCancelled();
- interactionEngine()->ensureContentWithinViewportBoundary(/*immediate*/ true);
+ interactionEngine()->cancelScrollAnimation();
return false;
case QEvent::TouchUpdate: {
ASSERT(m_state != NoGesture);
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (111014 => 111015)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-03-16 16:40:54 UTC (rev 111014)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-03-16 16:43:31 UTC (rev 111015)
@@ -489,6 +489,19 @@
return m_scaleAnimation->state() == QAbstractAnimation::Running;
}
+void QtViewportInteractionEngine::cancelScrollAnimation()
+{
+ ViewportUpdateDeferrer guard(this);
+
+ // If the pan gesture recognizer receives a touch begin event
+ // during an ongoing kinetic scroll animation of a previous
+ // pan gesture, the animation is stopped and the content is
+ // immediately positioned back to valid boundaries.
+
+ m_flickProvider->cancelFlick();
+ ensureContentWithinViewportBoundary(/*immediate*/ true);
+}
+
void QtViewportInteractionEngine::interruptScaleAnimation()
{
// This interrupts the scale animation exactly where it is, even if it is out of bounds.
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (111014 => 111015)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-03-16 16:40:54 UTC (rev 111014)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-03-16 16:43:31 UTC (rev 111015)
@@ -78,6 +78,7 @@
void pagePositionRequest(const QPoint& pos);
bool scrollAnimationActive() const;
+ void cancelScrollAnimation();
bool panGestureActive() const;
void panGestureStarted(const QTouchEvent*);
@@ -93,7 +94,6 @@
void pinchGestureRequestUpdate(const QPointF& pinchCenterInViewportCoordinates, qreal totalScaleFactor);
void pinchGestureEnded();
- bool ensureContentWithinViewportBoundary(bool immediate = false);
void zoomToAreaGestureEnded(const QPointF& touchPoint, const QRectF& targetArea);
void focusEditableArea(const QRectF& caretArea, const QRectF& targetArea);
@@ -134,6 +134,7 @@
qreal outerBoundedCSSScale(qreal);
QRectF computePosRangeForItemAtScale(qreal itemScale) const;
+ bool ensureContentWithinViewportBoundary(bool immediate = false);
void scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes