Changeset 130894 in webkit


Ignore:
Timestamp:
Oct 10, 2012 6:44:07 AM (12 years ago)
Author:
jocelyn.turcotte@digia.com
Message:

[Qt][WK2] REGRESSION(r130879): It made fast/events/touch/* tests crash
https://bugs.webkit.org/show_bug.cgi?id=98888

Reviewed by Kenneth Rohde Christiansen.

Add null-checks in the gesture recognizers to allow them working without a PageViewportController.
The pinch and pan gesture recognizers aren't used in that case yet, but they could eventually
be used to send pinch and pan gesture events to the web process. They are currently kept active
because we need the tap gesture recognizer and its logic is bound to those other recognizers.

  • UIProcess/qt/QtPanGestureRecognizer.cpp:

(WebKit::QtPanGestureRecognizer::update):
(WebKit::QtPanGestureRecognizer::finish):
(WebKit::QtPanGestureRecognizer::cancel):

  • UIProcess/qt/QtPinchGestureRecognizer.cpp:

(WebKit::QtPinchGestureRecognizer::update):
(WebKit::QtPinchGestureRecognizer::finish):
(WebKit::QtPinchGestureRecognizer::cancel):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r130886 r130894  
     12012-10-10  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
     2
     3        [Qt][WK2] REGRESSION(r130879): It made fast/events/touch/* tests crash
     4        https://bugs.webkit.org/show_bug.cgi?id=98888
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add null-checks in the gesture recognizers to allow them working without a PageViewportController.
     9        The pinch and pan gesture recognizers aren't used in that case yet, but they could eventually
     10        be used to send pinch and pan gesture events to the web process. They are currently kept active
     11        because we need the tap gesture recognizer and its logic is bound to those other recognizers.
     12
     13        * UIProcess/qt/QtPanGestureRecognizer.cpp:
     14        (WebKit::QtPanGestureRecognizer::update):
     15        (WebKit::QtPanGestureRecognizer::finish):
     16        (WebKit::QtPanGestureRecognizer::cancel):
     17        * UIProcess/qt/QtPinchGestureRecognizer.cpp:
     18        (WebKit::QtPinchGestureRecognizer::update):
     19        (WebKit::QtPinchGestureRecognizer::finish):
     20        (WebKit::QtPinchGestureRecognizer::cancel):
     21
    1222012-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    223
  • trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp

    r127720 r130894  
    3939bool QtPanGestureRecognizer::update(const QTouchEvent::TouchPoint& touchPoint, qint64 eventTimestampMillis)
    4040{
    41     if (!viewportController())
    42         return false;
    43 
    4441    m_lastPosition = touchPoint.pos();
    4542    m_lastEventTimestampMillis = eventTimestampMillis;
     
    4946        m_state = GestureRecognitionStarted;
    5047        m_firstScreenPosition = touchPoint.screenPos();
    51         viewportController()->cancelScrollAnimation();
     48        if (viewportController())
     49            viewportController()->cancelScrollAnimation();
    5250        return false;
    5351    case GestureRecognitionStarted: {
     
    5957
    6058        m_state = GestureRecognized;
    61         viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis);
     59        if (viewportController())
     60            viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis);
    6261        return true;
    6362    }
    6463    case GestureRecognized:
    65         viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis);
     64        if (viewportController())
     65            viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis);
    6666        return true;
    6767    default:
     
    7676        return;
    7777
    78     ASSERT(viewportController());
    79     viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);
     78    if (viewportController())
     79        viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);
    8080    reset();
    8181}
     
    8686        return;
    8787
    88     viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis);
    89     viewportController()->panGestureCancelled();
     88    if (viewportController()) {
     89        viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis);
     90        viewportController()->panGestureCancelled();
     91    }
    9092    reset();
    9193}
  • trunk/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp

    r127720 r130894  
    4949bool QtPinchGestureRecognizer::update(const QTouchEvent::TouchPoint& point1, const QTouchEvent::TouchPoint& point2)
    5050{
    51     ASSERT(viewportController());
    5251    const qreal currentFingerDistance = QLineF(point1.screenPos(), point2.screenPos()).length();
    5352    switch (m_state) {
     
    6160            return false;
    6261        m_state = GestureRecognized;
    63         viewportController()->pinchGestureStarted(computePinchCenter(point1, point2));
     62        if (viewportController())
     63            viewportController()->pinchGestureStarted(computePinchCenter(point1, point2));
    6464
    6565        // We reset the initial span distance to the current distance of the
     
    7373        const qreal totalScaleFactor = currentFingerDistance / m_initialFingerDistance;
    7474        const QPointF touchCenterInViewCoordinates = computePinchCenter(point1, point2);
    75         viewportController()->pinchGestureRequestUpdate(touchCenterInViewCoordinates, totalScaleFactor);
     75        if (viewportController())
     76            viewportController()->pinchGestureRequestUpdate(touchCenterInViewCoordinates, totalScaleFactor);
    7677        return true;
    7778        break;
     
    8788        return;
    8889
    89     ASSERT(viewportController());
    90     viewportController()->pinchGestureEnded();
     90    if (viewportController())
     91        viewportController()->pinchGestureEnded();
    9192    reset();
    9293}
     
    9798        return;
    9899
    99     ASSERT(viewportController());
    100     viewportController()->pinchGestureCancelled();
     100    if (viewportController())
     101        viewportController()->pinchGestureCancelled();
    101102    reset();
    102103}
Note: See TracChangeset for help on using the changeset viewer.