From 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 28 Sep 2016 16:39:37 +0300 Subject: Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3 Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev --- Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp') diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp index 8e7c5c221..9b620fb9d 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp @@ -188,7 +188,7 @@ void QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev) QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragEntered(&dragData); + m_webPageProxy->dragEntered(dragData); ev->acceptProposedAction(); } @@ -198,7 +198,7 @@ void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev) // FIXME: Should not use QCursor::pos() DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); - m_webPageProxy->dragExited(&dragData); + m_webPageProxy->dragExited(dragData); m_webPageProxy->resetDragOperation(); ev->setAccepted(accepted); @@ -211,7 +211,7 @@ void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev) QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); - m_webPageProxy->dragUpdated(&dragData); + m_webPageProxy->dragUpdated(dragData); ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); if (m_webPageProxy->dragSession().operation != DragOperationNone) ev->accept(); @@ -227,7 +227,7 @@ void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev) DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); SandboxExtension::Handle handle; SandboxExtension::HandleArray sandboxExtensionForUpload; - m_webPageProxy->performDrag(&dragData, String(), handle, sandboxExtensionForUpload); + m_webPageProxy->performDragOperation(dragData, String(), handle, sandboxExtensionForUpload); ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); ev->accept(); @@ -261,12 +261,14 @@ void QtWebPageEventHandler::deactivateTapHighlight() void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point) { +#if ENABLE(GESTURE_EVENTS) deactivateTapHighlight(); m_postponeTextInputStateChanged = true; QTransform fromItemTransform = m_webPage->transformFromItem(); WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0)); m_webPageProxy->handleGestureEvent(gesture); +#endif } void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point) @@ -300,12 +302,12 @@ void QtWebPageEventHandler::handleKeyReleaseEvent(QKeyEvent* ev) void QtWebPageEventHandler::handleFocusInEvent(QFocusEvent*) { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::handleFocusLost() { - m_webPageProxy->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive); + m_webPageProxy->viewStateDidChange(ViewState::IsFocused | ViewState::WindowIsActive); } void QtWebPageEventHandler::setViewportController(PageViewportControllerClientQt* controller) @@ -446,6 +448,7 @@ void QtWebPageEventHandler::handleWillSetInputMethodState() void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled) { +#if ENABLE(GESTURE_EVENTS) if (event.type() != WebEvent::GestureSingleTap) return; @@ -455,6 +458,7 @@ void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, b return; updateTextInputState(); +#endif } void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) -- cgit v1.2.1 From eaaf1391d58f17bde794d6c8634e092209898941 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Sun, 26 Mar 2017 13:55:39 +0300 Subject: Import WebKit commit 17e8bfb1ff30314a838b9bf641c112f63a11dba4 Change-Id: Ib6549e44a04300c7b7b07ddc9094b823b37f3183 Reviewed-by: Konstantin Tokarev --- Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp') diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp index 9b620fb9d..b56f475cc 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp @@ -261,12 +261,12 @@ void QtWebPageEventHandler::deactivateTapHighlight() void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point) { -#if ENABLE(GESTURE_EVENTS) +#if ENABLE(QT_GESTURE_EVENTS) deactivateTapHighlight(); m_postponeTextInputStateChanged = true; QTransform fromItemTransform = m_webPage->transformFromItem(); - WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0)); + WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize())); m_webPageProxy->handleGestureEvent(gesture); #endif } @@ -448,7 +448,7 @@ void QtWebPageEventHandler::handleWillSetInputMethodState() void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled) { -#if ENABLE(GESTURE_EVENTS) +#if ENABLE(QT_GESTURE_EVENTS) if (event.type() != WebEvent::GestureSingleTap) return; -- cgit v1.2.1 From 4bd713d56aa9bb86bc96ea9cb0c64cbf94bf43d4 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Mon, 24 Apr 2017 22:40:03 +0300 Subject: Import WebKit commit 3040e0455efecd271f1aeef53cf287e75486a70d Change-Id: I7df106cef8ce93ce33e49ad6fb0d202cd066d87c Reviewed-by: Konstantin Tokarev --- Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp') diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp index b56f475cc..d05649736 100644 --- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp +++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp @@ -184,7 +184,7 @@ void QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev) void QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev) { - m_webPageProxy->resetDragOperation(); + m_webPageProxy->resetCurrentDragInformation(); QTransform fromItemTransform = m_webPage->transformFromItem(); // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); @@ -199,7 +199,7 @@ void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev) // FIXME: Should not use QCursor::pos() DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); m_webPageProxy->dragExited(dragData); - m_webPageProxy->resetDragOperation(); + m_webPageProxy->resetCurrentDragInformation(); ev->setAccepted(accepted); } @@ -212,8 +212,8 @@ void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev) // FIXME: Should not use QCursor::pos() DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions())); m_webPageProxy->dragUpdated(dragData); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); - if (m_webPageProxy->dragSession().operation != DragOperationNone) + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); + if (m_webPageProxy->currentDragOperation() != DragOperationNone) ev->accept(); ev->setAccepted(accepted); @@ -228,7 +228,7 @@ void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev) SandboxExtension::Handle handle; SandboxExtension::HandleArray sandboxExtensionForUpload; m_webPageProxy->performDragOperation(dragData, String(), handle, sandboxExtensionForUpload); - ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation)); + ev->setDropAction(dragOperationToDropAction(m_webPageProxy->currentDragOperation())); ev->accept(); ev->setAccepted(accepted); @@ -566,7 +566,9 @@ void QtWebPageEventHandler::handleInputEvent(const QInputEvent* event) // Early return since this was a touch-end event. return; - } else if (activeTouchPointCount == 1) { + } + + if (activeTouchPointCount == 1) { // If the pinch gesture recognizer was previously in active state the content might // be out of valid zoom boundaries, thus we need to finish the pinch gesture here. // This will resume the content to valid zoom levels before the pan gesture is started. @@ -642,4 +644,3 @@ void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRef } // namespace WebKit #include "moc_QtWebPageEventHandler.cpp" - -- cgit v1.2.1