Changeset 130894 in webkit
- Timestamp:
- Oct 10, 2012 6:44:07 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r130886 r130894 1 2012-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 1 22 2012-10-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 23 -
trunk/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
r127720 r130894 39 39 bool QtPanGestureRecognizer::update(const QTouchEvent::TouchPoint& touchPoint, qint64 eventTimestampMillis) 40 40 { 41 if (!viewportController())42 return false;43 44 41 m_lastPosition = touchPoint.pos(); 45 42 m_lastEventTimestampMillis = eventTimestampMillis; … … 49 46 m_state = GestureRecognitionStarted; 50 47 m_firstScreenPosition = touchPoint.screenPos(); 51 viewportController()->cancelScrollAnimation(); 48 if (viewportController()) 49 viewportController()->cancelScrollAnimation(); 52 50 return false; 53 51 case GestureRecognitionStarted: { … … 59 57 60 58 m_state = GestureRecognized; 61 viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis); 59 if (viewportController()) 60 viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis); 62 61 return true; 63 62 } 64 63 case GestureRecognized: 65 viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis); 64 if (viewportController()) 65 viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis); 66 66 return true; 67 67 default: … … 76 76 return; 77 77 78 ASSERT(viewportController());79 viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);78 if (viewportController()) 79 viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis); 80 80 reset(); 81 81 } … … 86 86 return; 87 87 88 viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis); 89 viewportController()->panGestureCancelled(); 88 if (viewportController()) { 89 viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis); 90 viewportController()->panGestureCancelled(); 91 } 90 92 reset(); 91 93 } -
trunk/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp
r127720 r130894 49 49 bool QtPinchGestureRecognizer::update(const QTouchEvent::TouchPoint& point1, const QTouchEvent::TouchPoint& point2) 50 50 { 51 ASSERT(viewportController());52 51 const qreal currentFingerDistance = QLineF(point1.screenPos(), point2.screenPos()).length(); 53 52 switch (m_state) { … … 61 60 return false; 62 61 m_state = GestureRecognized; 63 viewportController()->pinchGestureStarted(computePinchCenter(point1, point2)); 62 if (viewportController()) 63 viewportController()->pinchGestureStarted(computePinchCenter(point1, point2)); 64 64 65 65 // We reset the initial span distance to the current distance of the … … 73 73 const qreal totalScaleFactor = currentFingerDistance / m_initialFingerDistance; 74 74 const QPointF touchCenterInViewCoordinates = computePinchCenter(point1, point2); 75 viewportController()->pinchGestureRequestUpdate(touchCenterInViewCoordinates, totalScaleFactor); 75 if (viewportController()) 76 viewportController()->pinchGestureRequestUpdate(touchCenterInViewCoordinates, totalScaleFactor); 76 77 return true; 77 78 break; … … 87 88 return; 88 89 89 ASSERT(viewportController());90 viewportController()->pinchGestureEnded();90 if (viewportController()) 91 viewportController()->pinchGestureEnded(); 91 92 reset(); 92 93 } … … 97 98 return; 98 99 99 ASSERT(viewportController());100 viewportController()->pinchGestureCancelled();100 if (viewportController()) 101 viewportController()->pinchGestureCancelled(); 101 102 reset(); 102 103 }
Note: See TracChangeset
for help on using the changeset viewer.