diff options
-rw-r--r-- | Source/WebCore/page/EventHandler.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/platform/PlatformTouchEvent.h | 4 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 111 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 21 |
4 files changed, 1 insertions, 143 deletions
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index a737754..45450b5 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -3224,15 +3224,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) // When sending a touch cancel event, use empty touches and targetTouches lists. bool isTouchCancelEvent = (state == PlatformTouchPoint::TouchCancelled); RefPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches); -#if PLATFORM(ANDROID) - AtomicString stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state))); - if (event.type() == TouchLongPress) - stateName = eventNames().touchlongpressEvent; - else if (event.type() == TouchDoubleTap) - stateName = eventNames().touchdoubletapEvent; -#else const AtomicString& stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state))); -#endif const EventTargetSet& targetsForState = changedTouches[state].m_targets; for (EventTargetSet::const_iterator it = targetsForState.begin(); it != targetsForState.end(); ++it) { diff --git a/Source/WebCore/platform/PlatformTouchEvent.h b/Source/WebCore/platform/PlatformTouchEvent.h index 2ca7c99..f7524b4 100644 --- a/Source/WebCore/platform/PlatformTouchEvent.h +++ b/Source/WebCore/platform/PlatformTouchEvent.h @@ -52,10 +52,6 @@ enum TouchEventType { , TouchMove , TouchEnd , TouchCancel -#if PLATFORM(ANDROID) - , TouchLongPress - , TouchDoubleTap -#endif }; class PlatformTouchEvent { diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index bf87668..0b5989d 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -3123,27 +3123,6 @@ void WebViewCore::chromeTakeFocus(FocusDirection direction) env->CallVoidMethod(javaObject.get(), m_javaGlue->m_chromeTakeFocus, direction); } -// For when the user clicks the trackball, presses dpad center, or types into an -// unfocused textfield. In the latter case, 'fake' will be true -void WebViewCore::click(WebCore::Frame* frame, WebCore::Node* node, bool fake) { - if (!node) { - WebCore::IntPoint pt = m_mousePos; - pt.move(m_scrollOffsetX, m_scrollOffsetY); - WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()-> - hitTestResultAtPoint(pt, false); - node = hitTestResult.innerNode(); - frame = node->document()->frame(); - } - if (node) { - EditorClientAndroid* client - = static_cast<EditorClientAndroid*>( - m_mainFrame->editor()->client()); - client->setShouldChangeSelectedRange(false); - handleMouseClick(frame, node, fake); - client->setShouldChangeSelectedRange(true); - } -} - #if USE(ACCELERATED_COMPOSITING) GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const { @@ -3198,14 +3177,6 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint type = WebCore::TouchEnd; defaultTouchState = WebCore::PlatformTouchPoint::TouchStationary; break; - case 0x100: // WebViewCore.ACTION_LONGPRESS - type = WebCore::TouchLongPress; - defaultTouchState = WebCore::PlatformTouchPoint::TouchPressed; - break; - case 0x200: // WebViewCore.ACTION_DOUBLETAP - type = WebCore::TouchDoubleTap; - defaultTouchState = WebCore::PlatformTouchPoint::TouchPressed; - break; default: // We do not support other kinds of touch event inside WebCore // at the moment. @@ -3239,31 +3210,6 @@ bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint return preventDefault; } -void WebViewCore::touchUp(int touchGeneration, - WebCore::Frame* frame, WebCore::Node* node, int x, int y) -{ - if (touchGeneration == 0) { - // m_mousePos should be set in getTouchHighlightRects() - WebCore::HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(m_mousePos, false); - node = hitTestResult.innerNode(); - if (node) - frame = node->document()->frame(); - else - frame = 0; - } else { - if (m_touchGeneration > touchGeneration) - return; // short circuit if a newer touch has been generated - // This moves m_mousePos to the correct place, and handleMouseClick uses - // m_mousePos to determine where the click happens. - moveMouse(x, y); - m_lastGeneration = touchGeneration; - } - if (frame && validNode(m_mainFrame, frame, 0)) { - frame->loader()->resetMultipleFormSubmissionProtection(); - } - handleMouseClick(frame, node, false); -} - bool WebViewCore::performMouseClick() { WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, @@ -3297,38 +3243,6 @@ static bool shouldSuppressKeyboard(const WebCore::Node* node) { return false; } -// Common code for both clicking with the trackball and touchUp -// Also used when typing into a non-focused textfield to give the textfield focus, -// in which case, 'fake' is set to true -bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* nodePtr, bool fake) -{ - bool valid = !framePtr || validNode(m_mainFrame, framePtr, nodePtr); - WebFrame* webFrame = WebFrame::getWebFrame(m_mainFrame); - if (valid && nodePtr) { - // Need to special case area tags because an image map could have an area element in the middle - // so when attempting to get the default, the point chosen would be follow the wrong link. - if (nodePtr->hasTagName(WebCore::HTMLNames::areaTag)) { - nodePtr->dispatchSimulatedClick(0, true, true); - return true; - } - } - if (!valid || !framePtr) - framePtr = m_mainFrame; - WebCore::PlatformMouseEvent mouseDown(m_mousePos, m_mousePos, WebCore::LeftButton, - WebCore::MouseEventPressed, 1, false, false, false, false, - WTF::currentTime()); - // ignore the return from as it will return true if the hit point can trigger selection change - framePtr->eventHandler()->handleMousePressEvent(mouseDown); - WebCore::PlatformMouseEvent mouseUp(m_mousePos, m_mousePos, WebCore::LeftButton, - WebCore::MouseEventReleased, 1, false, false, false, false, - WTF::currentTime()); - bool handled = framePtr->eventHandler()->handleMouseReleaseEvent(mouseUp); - - WebCore::Node* focusNode = currentFocus(); - initializeTextInput(focusNode, fake); - return handled; -} - WebViewCore::InputType WebViewCore::getInputType(Node* node) { WebCore::RenderObject* renderer = node->renderer(); @@ -4474,16 +4388,6 @@ static jboolean Key(JNIEnv* env, jobject obj, jint nativeClass, jint keyCode, unichar, repeatCount, isDown, isShift, isAlt, isSym)); } -static void Click(JNIEnv* env, jobject obj, jint nativeClass, int framePtr, - int nodePtr, jboolean fake) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in Click"); - - viewImpl->click(reinterpret_cast<WebCore::Frame*>(framePtr), - reinterpret_cast<WebCore::Node*>(nodePtr), fake); -} - static void ContentInvalidateAll(JNIEnv* env, jobject obj, jint nativeClass) { reinterpret_cast<WebViewCore*>(nativeClass)->contentInvalidateAll(); @@ -4661,15 +4565,6 @@ static jboolean HandleTouchEvent(JNIEnv* env, jobject obj, jint nativeClass, return viewImpl->handleTouchEvent(action, ids, points, actionIndex, metaState); } -static void TouchUp(JNIEnv* env, jobject obj, jint nativeClass, - jint touchGeneration, jint frame, jint node, jint x, jint y) -{ - WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); - ALOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); - viewImpl->touchUp(touchGeneration, - (WebCore::Frame*) frame, (WebCore::Node*) node, x, y); -} - static bool MouseClick(JNIEnv* env, jobject obj, jint nativeClass) { WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass); @@ -5059,8 +4954,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) FocusBoundsChanged } , { "nativeKey", "(IIIIZZZZ)Z", (void*) Key }, - { "nativeClick", "(IIIZ)V", - (void*) Click }, { "nativeContentInvalidateAll", "(I)V", (void*) ContentInvalidateAll }, { "nativeSendListBoxChoices", "(I[ZI)V", @@ -5094,9 +4987,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", (void*) FindAddress }, { "nativeHandleTouchEvent", "(II[I[I[IIII)Z", - (void*) HandleTouchEvent }, - { "nativeTouchUp", "(IIIIII)V", - (void*) TouchUp }, + (void*) HandleTouchEvent }, { "nativeMouseClick", "(I)Z", (void*) MouseClick }, { "nativeRetrieveHref", "(III)Ljava/lang/String;", diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 00b4bda..82a65cf 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -323,13 +323,6 @@ namespace android { void chromeTakeFocus(WebCore::FocusDirection direction); /** - * Handle (trackball) click event / dpad center press from Java. - * Also used when typing into an unfocused textfield, in which case 'fake' - * will be true. - */ - void click(WebCore::Frame* frame, WebCore::Node* node, bool fake); - - /** * Handle touch event */ bool handleTouchEvent(int action, WTF::Vector<int>& ids, @@ -337,19 +330,6 @@ namespace android { int actionIndex, int metaState); /** - * Handle motionUp event from the UI thread (called touchUp in the - * WebCore thread). - * @param touchGeneration Generation number for touches so we can ignore - * touches when a newer one has been generated. - * @param frame Pointer to Frame containing the node that was touched. - * @param node Pointer to Node that was touched. - * @param x x-position of the touch. - * @param y y-position of the touch. - */ - void touchUp(int touchGeneration, WebCore::Frame* frame, - WebCore::Node* node, int x, int y); - - /** * Clicks the mouse at its current location */ bool performMouseClick(); @@ -659,7 +639,6 @@ namespace android { * @param fake This is a fake mouse click, used to put a textfield into focus. Do not * open the IME. */ - bool handleMouseClick(WebCore::Frame*, WebCore::Node*, bool fake); WebCore::HTMLAnchorElement* retrieveAnchorElement(int x, int y); WebCore::HTMLElement* retrieveElement(int x, int y, const WebCore::QualifiedName& ); |