Changeset 102488 in webkit
- Timestamp:
- Dec 9, 2011 3:53:35 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r102486 r102488 1 2011-12-09 Hugo Parente Lima <hugo.lima@openbossa.org> 2 3 [Qt] Click's count is limited to three continuous clicks. 4 https://bugs.webkit.org/show_bug.cgi?id=45666 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Enable fast/events/click-count.html for qt and disable for qt-wk1. 9 10 * platform/qt-wk1/Skipped: 11 * platform/qt/Skipped: 12 1 13 2011-12-09 Tony Chang <tony@chromium.org> 2 14 -
trunk/LayoutTests/platform/qt-wk1/Skipped
r102117 r102488 5 5 fast/events/dont-loose-last-event.html 6 6 7 # This has been fixed only on qt-wk2 8 # https://bugs.webkit.org/show_bug.cgi?id=45666 9 fast/events/click-count.html 10 7 11 # [Qt] http/tests/misc/drag-over-iframe-invalid-source-crash.html and fast/events/drag-selects-image.html fails with timeout 8 12 # https://bugs.webkit.org/show_bug.cgi?id=73901 -
trunk/LayoutTests/platform/qt/Skipped
r102300 r102488 1131 1131 fast/encoding/GBK/x-gbk.html 1132 1132 fast/events/autoscroll.html 1133 fast/events/click-count.html1134 1133 fast/events/content-changed-during-drop.html 1135 1134 fast/events/js-keyboard-event-creation.html -
trunk/Source/WebKit2/ChangeLog
r102484 r102488 1 2011-12-09 Hugo Parente Lima <hugo.lima@openbossa.org> 2 3 [Qt] Click's count is limited to three continuous clicks. 4 https://bugs.webkit.org/show_bug.cgi?id=45666 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Make Qt recognize "infinite" continuous mouse clicks. 9 handleMouseDoubleClickEvent merged into handleMousePressEvent. 10 11 * UIProcess/qt/QtWebPageEventHandler.cpp: 12 (QtWebPageEventHandler::QtWebPageEventHandler): 13 (QtWebPageEventHandler::handleEvent): 14 (QtWebPageEventHandler::handleMousePressEvent): 15 (QtWebPageEventHandler::timerEvent): 16 * UIProcess/qt/QtWebPageEventHandler.h: 17 1 18 2011-12-09 Sam Weinig <sam@webkit.org> 2 19 -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
r102136 r102488 84 84 , m_pinchGestureRecognizer(this) 85 85 , m_tapGestureRecognizer(this) 86 , m_previousClickButton(Qt::NoButton) 87 , m_clickCount(0) 86 88 { 87 89 } … … 95 97 switch (ev->type()) { 96 98 case QEvent::MouseMove: 97 return handleMouseMoveEvent( reinterpret_cast<QMouseEvent*>(ev));99 return handleMouseMoveEvent(static_cast<QMouseEvent*>(ev)); 98 100 case QEvent::MouseButtonPress: 99 return handleMousePressEvent(reinterpret_cast<QMouseEvent*>(ev)); 101 case QEvent::MouseButtonDblClick: 102 // If a MouseButtonDblClick was received then we got a MouseButtonPress before 103 // handleMousePressEvent will take care of double clicks. 104 return handleMousePressEvent(static_cast<QMouseEvent*>(ev)); 100 105 case QEvent::MouseButtonRelease: 101 return handleMouseReleaseEvent(reinterpret_cast<QMouseEvent*>(ev)); 102 case QEvent::MouseButtonDblClick: 103 return handleMouseDoubleClickEvent(reinterpret_cast<QMouseEvent*>(ev)); 106 return handleMouseReleaseEvent(static_cast<QMouseEvent*>(ev)); 104 107 case QEvent::Wheel: 105 return handleWheelEvent( reinterpret_cast<QWheelEvent*>(ev));108 return handleWheelEvent(static_cast<QWheelEvent*>(ev)); 106 109 case QEvent::HoverLeave: 107 return handleHoverLeaveEvent( reinterpret_cast<QHoverEvent*>(ev));110 return handleHoverLeaveEvent(static_cast<QHoverEvent*>(ev)); 108 111 case QEvent::HoverEnter: // Fall-through, for WebKit the distinction doesn't matter. 109 112 case QEvent::HoverMove: 110 return handleHoverMoveEvent( reinterpret_cast<QHoverEvent*>(ev));113 return handleHoverMoveEvent(static_cast<QHoverEvent*>(ev)); 111 114 case QEvent::DragEnter: 112 return handleDragEnterEvent( reinterpret_cast<QDragEnterEvent*>(ev));115 return handleDragEnterEvent(static_cast<QDragEnterEvent*>(ev)); 113 116 case QEvent::DragLeave: 114 return handleDragLeaveEvent( reinterpret_cast<QDragLeaveEvent*>(ev));117 return handleDragLeaveEvent(static_cast<QDragLeaveEvent*>(ev)); 115 118 case QEvent::DragMove: 116 return handleDragMoveEvent( reinterpret_cast<QDragMoveEvent*>(ev));119 return handleDragMoveEvent(static_cast<QDragMoveEvent*>(ev)); 117 120 case QEvent::Drop: 118 return handleDropEvent( reinterpret_cast<QDropEvent*>(ev));121 return handleDropEvent(static_cast<QDropEvent*>(ev)); 119 122 case QEvent::KeyPress: 120 return handleKeyPressEvent( reinterpret_cast<QKeyEvent*>(ev));123 return handleKeyPressEvent(static_cast<QKeyEvent*>(ev)); 121 124 case QEvent::KeyRelease: 122 return handleKeyReleaseEvent( reinterpret_cast<QKeyEvent*>(ev));125 return handleKeyReleaseEvent(static_cast<QKeyEvent*>(ev)); 123 126 case QEvent::FocusIn: 124 return handleFocusInEvent( reinterpret_cast<QFocusEvent*>(ev));127 return handleFocusInEvent(static_cast<QFocusEvent*>(ev)); 125 128 case QEvent::FocusOut: 126 return handleFocusOutEvent( reinterpret_cast<QFocusEvent*>(ev));129 return handleFocusOutEvent(static_cast<QFocusEvent*>(ev)); 127 130 case QEvent::TouchBegin: 128 131 case QEvent::TouchEnd: … … 155 158 bool QtWebPageEventHandler::handleMousePressEvent(QMouseEvent* ev) 156 159 { 157 if (m_tripleClickTimer.isActive() && (ev->pos() - m_tripleClick).manhattanLength() < qApp->styleHints()->startDragDistance()) { 158 m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 3)); 159 return ev->isAccepted(); 160 } 161 162 m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 1)); 160 if (m_clickTimer.isActive() 161 && m_previousClickButton == ev->button() 162 && (ev->pos() - m_lastClick).manhattanLength() < qApp->styleHints()->startDragDistance()) { 163 m_clickCount++; 164 } else { 165 m_clickCount = 1; 166 m_previousClickButton = ev->button(); 167 } 168 169 m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, m_clickCount)); 170 171 m_lastClick = ev->pos(); 172 m_clickTimer.start(qApp->styleHints()->mouseDoubleClickInterval(), this); 163 173 return ev->isAccepted(); 164 174 } … … 167 177 { 168 178 m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 0)); 169 return ev->isAccepted();170 }171 172 bool QtWebPageEventHandler::handleMouseDoubleClickEvent(QMouseEvent* ev)173 {174 m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 2));175 176 m_tripleClickTimer.start(qApp->styleHints()->mouseDoubleClickInterval(), this);177 m_tripleClick = ev->localPos().toPoint();178 179 return ev->isAccepted(); 179 180 } … … 273 274 { 274 275 int timerId = ev->timerId(); 275 if (timerId == m_ tripleClickTimer.timerId())276 m_ tripleClickTimer.stop();276 if (timerId == m_clickTimer.timerId()) 277 m_clickTimer.stop(); 277 278 else 278 279 QObject::timerEvent(ev); -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
r102136 r102488 74 74 bool handleMousePressEvent(QMouseEvent*); 75 75 bool handleMouseReleaseEvent(QMouseEvent*); 76 bool handleMouseDoubleClickEvent(QMouseEvent*);77 76 bool handleWheelEvent(QWheelEvent*); 78 77 bool handleHoverLeaveEvent(QHoverEvent*); … … 87 86 void touchEvent(QTouchEvent*); 88 87 89 QPoint m_tripleClick; 90 QBasicTimer m_tripleClickTimer; 88 QPoint m_lastClick; 89 QBasicTimer m_clickTimer; 90 Qt::MouseButton m_previousClickButton; 91 int m_clickCount; 91 92 }; 92 93 -
trunk/Tools/ChangeLog
r102487 r102488 1 2011-12-09 Hugo Parente Lima <hugo.lima@openbossa.org> 2 3 [Qt] Click's count is limited to three continuous clicks. 4 https://bugs.webkit.org/show_bug.cgi?id=45666 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Update m_time at every call to leapForward, so double clicks 9 event are correctly sent by EventSender. 10 11 * WebKitTestRunner/qt/EventSenderProxyQt.cpp: 12 (WTR::EventSenderProxy::updateClickCountForButton): 13 (WTR::EventSenderProxy::leapForward): 14 1 15 2011-12-09 Kentaro Hara <haraken@chromium.org> 2 16 -
trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
r102048 r102488 247 247 void EventSenderProxy::updateClickCountForButton(int button) 248 248 { 249 if (m_time - m_clickTime < QApplication::doubleClickInterval() / 1000.0&& m_position == m_clickPosition && button == m_clickButton) {249 if (m_time - m_clickTime < QApplication::doubleClickInterval() && m_position == m_clickPosition && button == m_clickButton) { 250 250 ++m_clickCount; 251 251 m_clickTime = m_time; … … 307 307 { 308 308 eventQueue[endOfQueue].m_delay = ms; 309 m_time += ms; 309 310 } 310 311
Note: See TracChangeset
for help on using the changeset viewer.