Changeset 132052 in webkit
- Timestamp:
- Oct 22, 2012 2:48:58 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r132047 r132052 1 2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt] Basic gesture event handling 4 https://bugs.webkit.org/show_bug.cgi?id=66173 5 6 Reviewed by Simon Hausmann. 7 8 * platform/qt-5.0-wk2/TestExpectations: 9 * platform/qt/TestExpectations: 10 * platform/qt/fast/events/touch/gesture/gesture-click-expected.txt: Added. 11 1 12 2012-10-22 Shinya Kawanaka <shinyak@chromium.org> 2 13 -
trunk/LayoutTests/platform/qt-5.0-wk2/TestExpectations
r131909 r132052 65 65 # eventSender.gestureTap 66 66 fast/events/touch/gesture/gesture-click.html 67 # eventSender.gestureLongPress 68 fast/events/touch/gesture/context-menu-on-long-press.html 69 touchadjustment/touch-links-longpress.html 67 70 # eventSender.beginDragWithFiles 68 71 fast/dom/Window/window-postmessage-clone-frames.html … … 608 611 http/tests/security/cookies/third-party-cookie-blocking.html 609 612 610 [Qt][WK2] http/tests/misc/willCacheResponse-delegate-callback.html fails613 # [Qt][WK2] http/tests/misc/willCacheResponse-delegate-callback.html fails 611 614 webkit.org/b/99148 http/tests/misc/willCacheResponse-delegate-callback.html 612 615 613 [Qt][WK2] REGRESSION(r131057): It made plugins/plugin-document-back-forward.html timeout616 # [Qt][WK2] REGRESSION(r131057): It made plugins/plugin-document-back-forward.html timeout 614 617 webkit.org/b/99152 plugins/plugin-document-back-forward.html 615 618 616 [Qt][WK2] http/tests/navigation/ping-cross-origin-from-https.html fails619 # [Qt][WK2] http/tests/navigation/ping-cross-origin-from-https.html fails 617 620 webkit.org/b/99155 http/tests/navigation/ping-cross-origin-from-https.html 618 621 -
trunk/LayoutTests/platform/qt/TestExpectations
r132043 r132052 431 431 fast/js/names.html 432 432 433 # Don't have GestureLongPress, GestureTapCancel event types 434 touchadjustment/touch-links-longpress.html 433 # Don't have GestureTapCancel event type 435 434 touchadjustment/touch-links-active.html 436 435 … … 1960 1959 fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy.html 1961 1960 fast/dynamic/text-combine.html 1962 fast/events/touch/gesture/context-menu-on-long-press.html1963 1961 fast/events/touch/gesture/context-menu-on-two-finger-tap.html 1964 1962 fast/images/pixel-crack-image-background-webkit-transform-scale.html -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r130612 r132052 95 95 #include "PageGroup.h" 96 96 #include "Pasteboard.h" 97 #include "PlatformGestureEvent.h" 97 98 #include "PlatformKeyboardEvent.h" 98 99 #include "PlatformTouchEvent.h" … … 132 133 #include <QDropEvent> 133 134 #include <QFileDialog> 135 #include <QGestureEvent> 134 136 #include <QInputDialog> 135 137 #include <QLabel> … … 1328 1330 // Return whether the default action was cancelled in the JS event handler 1329 1331 return frame->eventHandler()->handleTouchEvent(convertTouchEvent(event)); 1332 #else 1333 event->ignore(); 1334 return false; 1335 #endif 1336 } 1337 1338 bool QWebPagePrivate::gestureEvent(QGestureEvent* event) 1339 { 1340 #if ENABLE(GESTURE_EVENTS) 1341 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame.data()); 1342 if (!frame->view()) 1343 return false; 1344 1345 // QGestureEvents can contain updates for multiple gestures. 1346 bool handled = false; 1347 QGesture* gesture = event->gesture(Qt::TapGesture); 1348 // Beware that gestures send by DumpRenderTree will have state Qt::NoGesture, 1349 // due to not originating from a GestureRecognizer. 1350 if (gesture && (gesture->state() == Qt::GestureStarted || gesture->state() == Qt::NoGesture)) { 1351 frame->eventHandler()->handleGestureEvent(convertGesture(event, gesture)); 1352 event->setAccepted(true); 1353 handled = true; 1354 } 1355 gesture = event->gesture(Qt::TapAndHoldGesture); 1356 if (gesture && (gesture->state() == Qt::GestureStarted || gesture->state() == Qt::NoGesture)) { 1357 frame->eventHandler()->sendContextMenuEventForGesture(convertGesture(event, gesture)); 1358 event->setAccepted(true); 1359 handled = true; 1360 } 1361 1362 return handled; 1330 1363 #else 1331 1364 event->ignore(); … … 3144 3177 // Return whether the default action was cancelled in the JS event handler 3145 3178 return d->touchEvent(static_cast<QTouchEvent*>(ev)); 3179 #ifndef QT_NO_GESTURES 3180 case QEvent::Gesture: 3181 d->gestureEvent(static_cast<QGestureEvent*>(ev)); 3182 break; 3183 #endif 3146 3184 #ifndef QT_NO_PROPERTIES 3147 3185 case QEvent::DynamicPropertyChange: -
trunk/Source/WebKit/qt/Api/qwebpage_p.h
r129750 r132052 27 27 #include <qnetworkproxy.h> 28 28 #include <qevent.h> 29 #include <qgesture.h> 29 30 #include <qgraphicssceneevent.h> 30 31 … … 134 135 bool touchEvent(QTouchEvent*); 135 136 137 bool gestureEvent(QGestureEvent*); 138 136 139 class TouchAdjuster { 137 140 public: -
trunk/Source/WebKit/qt/ChangeLog
r131716 r132052 1 2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt] Basic gesture event handling 4 https://bugs.webkit.org/show_bug.cgi?id=66173 5 6 Reviewed by Simon Hausmann. 7 8 Implement basic handling of QGestureEvent converting and forwarding 9 Tap and TapAndHold gestures to WebCore. 10 11 * Api/qwebpage.cpp: 12 (QWebPagePrivate::gestureEvent): 13 (QWebPage::event): 14 * Api/qwebpage_p.h: 15 (QWebPagePrivate): 16 * WebCoreSupport/WebEventConversion.cpp: 17 (WebKitPlatformGestureEvent): 18 (WebCore::WebKitPlatformGestureEvent::WebKitPlatformGestureEvent): 19 (WebCore::convertGesture): 20 * WebCoreSupport/WebEventConversion.h: 21 1 22 2012-10-17 Tor Arne Vestbø <tor.arne.vestbo@digia.com> 2 23 -
trunk/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
r124879 r132052 23 23 #include "WebEventConversion.h" 24 24 25 #include "PlatformGestureEvent.h" 25 26 #include "PlatformMouseEvent.h" 26 27 #include "PlatformTouchEvent.h" … … 28 29 #include "PlatformWheelEvent.h" 29 30 #include <QApplication> 31 #include <QGesture> 32 #include <QGestureEvent> 30 33 #include <QGraphicsSceneMouseEvent> 31 34 #include <QTouchEvent> 32 35 #include <QWheelEvent> 36 #include <QWidget> 33 37 #include <wtf/CurrentTime.h> 34 38 … … 303 307 #endif 304 308 309 #if ENABLE(GESTURE_EVENTS) 310 class WebKitPlatformGestureEvent : public PlatformGestureEvent { 311 public: 312 WebKitPlatformGestureEvent(const QGestureEvent*, const QGesture*); 313 }; 314 315 WebKitPlatformGestureEvent::WebKitPlatformGestureEvent(const QGestureEvent* event, const QGesture* gesture) 316 { 317 switch (gesture->gestureType()) { 318 case Qt::TapGesture: { 319 m_type = PlatformEvent::GestureTap; 320 QPointF globalPos = static_cast<const QTapGesture*>(gesture)->position(); 321 m_globalPosition = globalPos.toPoint(); 322 m_position = event->widget()->mapFromGlobal(globalPos.toPoint()); 323 break; 324 } 325 case Qt::TapAndHoldGesture: { 326 m_type = PlatformEvent::GestureLongPress; 327 QPointF globalPos = static_cast<const QTapAndHoldGesture*>(gesture)->position(); 328 m_globalPosition = globalPos.toPoint(); 329 m_position = event->widget()->mapFromGlobal(globalPos.toPoint()); 330 break; 331 } 332 default: 333 ASSERT_NOT_REACHED(); 334 break; 335 } 336 m_timestamp = WTF::currentTime(); 337 } 338 339 #endif 340 305 341 PlatformWheelEvent convertWheelEvent(QWheelEvent* event) 306 342 { … … 320 356 #endif 321 357 322 } 358 #if ENABLE(GESTURE_EVENTS) 359 PlatformGestureEvent convertGesture(QGestureEvent* event, QGesture* gesture) 360 { 361 return WebKitPlatformGestureEvent(event, gesture); 362 } 363 #endif 364 365 } -
trunk/Source/WebKit/qt/WebCoreSupport/WebEventConversion.h
r115420 r132052 28 28 class QGraphicsSceneWheelEvent; 29 29 class QTouchEvent; 30 class QGesture; 31 class QGestureEvent; 30 32 QT_END_NAMESPACE 31 33 … … 34 36 class PlatformMouseEvent; 35 37 class PlatformWheelEvent; 36 37 38 38 39 PlatformMouseEvent convertMouseEvent(QInputEvent*, int clickCount); … … 45 46 PlatformTouchEvent convertTouchEvent(QTouchEvent*); 46 47 #endif 48 49 #if ENABLE(GESTURE_EVENTS) 50 class PlatformGestureEvent; 51 PlatformGestureEvent convertGesture(QGestureEvent*, QGesture*); 52 #endif 47 53 } -
trunk/Tools/ChangeLog
r132050 r132052 1 2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt] Basic gesture event handling 4 https://bugs.webkit.org/show_bug.cgi?id=66173 5 6 Reviewed by Simon Hausmann. 7 8 Add support for eventSender.gestureLongPress. 9 10 * DumpRenderTree/qt/EventSenderQt.cpp: 11 (EventSender::EventSender): 12 (EventSender::gestureLongPress): 13 * DumpRenderTree/qt/EventSenderQt.h: 14 (EventSender): 15 1 16 2012-10-22 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 17 -
trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp
r130877 r132052 63 63 #ifndef QT_NO_GESTURES 64 64 , m_tapGesture(parent) 65 , m_tapAndHoldGesture(parent) 65 66 #endif 66 67 { … … 578 579 sendEvent(m_page, &event); 579 580 } 581 582 void EventSender::gestureLongPress(int x, int y) 583 { 584 m_tapAndHoldGesture.setPosition(QPointF(x, y)); 585 m_gestures.clear(); 586 m_gestures.append(&m_tapAndHoldGesture); 587 QGestureEvent event(m_gestures); 588 sendEvent(m_page, &event); 589 } 580 590 #endif 581 591 -
trunk/Tools/DumpRenderTree/qt/EventSenderQt.h
r130877 r132052 89 89 #ifndef QT_NO_GESTURES 90 90 void gestureTap(int x, int y); 91 void gestureLongPress(int x, int y); 91 92 #endif 92 93 void beginDragWithFiles(const QStringList& files); … … 124 125 #ifndef QT_NO_GESTURES 125 126 QTapGesture m_tapGesture; 127 QTapAndHoldGesture m_tapAndHoldGesture; 126 128 QList<QGesture*> m_gestures; 127 129 #endif
Note: See TracChangeset
for help on using the changeset viewer.