diff options
Diffstat (limited to 'WebKit/android/nav/WebView.cpp')
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 4b32516..20daafc 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -106,6 +106,7 @@ struct JavaGlue { jmethodID m_getScaledMaxYScroll; jmethodID m_getVisibleRect; jmethodID m_rebuildWebTextView; + jmethodID m_setOkayToNotMatch; jmethodID m_displaySoftKeyboard; jmethodID m_viewInvalidate; jmethodID m_viewInvalidateRect; @@ -134,6 +135,7 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl) m_javaGlue.m_getScaledMaxYScroll = GetJMethod(env, clazz, "getScaledMaxYScroll", "()I"); m_javaGlue.m_getVisibleRect = GetJMethod(env, clazz, "sendOurVisibleRect", "()Landroid/graphics/Rect;"); m_javaGlue.m_rebuildWebTextView = GetJMethod(env, clazz, "rebuildWebTextView", "()V"); + m_javaGlue.m_setOkayToNotMatch = GetJMethod(env, clazz, "setOkayNotToMatch", "()V"); m_javaGlue.m_displaySoftKeyboard = GetJMethod(env, clazz, "displaySoftKeyboard", "(Z)V"); m_javaGlue.m_viewInvalidate = GetJMethod(env, clazz, "viewInvalidate", "()V"); m_javaGlue.m_viewInvalidateRect = GetJMethod(env, clazz, "viewInvalidate", "(IIII)V"); @@ -739,7 +741,8 @@ void updateCursorBounds(const CachedRoot* root, const CachedFrame* cachedFrame, m_viewImpl->m_cursorBounds = cachedNode->bounds(); m_viewImpl->m_cursorHitBounds = cachedNode->hitBounds(); m_viewImpl->m_cursorFrame = cachedFrame->framePointer(); - root->getSimulatedMousePosition(&m_viewImpl->m_cursorLocation); + root->getSimulatedMousePosition(cachedNode, + &m_viewImpl->m_cursorLocation); m_viewImpl->m_cursorNode = cachedNode->nodePointer(); } m_viewImpl->gCursorBoundsMutex.unlock(); @@ -835,7 +838,7 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll) void notifyProgressFinished() { DBG_NAV_LOGD("cursorIsTextInput=%d", cursorIsTextInput(DontAllowNewer)); - rebuildWebTextView(); + rebuildWebTextView(false); #if DEBUG_NAV_UI if (m_frameCacheUI) { const CachedNode* focus = m_frameCacheUI->currentFocus(); @@ -967,7 +970,7 @@ bool motionUp(int x, int y, int slop) } viewInvalidate(); if (result->isTextField() || result->isTextArea()) { - rebuildWebTextView(); + rebuildWebTextView(true); if (!result->isReadOnly()) { displaySoftKeyboard(true); } @@ -1267,7 +1270,7 @@ bool hasFocusNode() return focusNode; } -void rebuildWebTextView() +void rebuildWebTextView(bool needNotMatchFocus) { JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject obj = m_javaGlue.object(env); @@ -1277,6 +1280,10 @@ void rebuildWebTextView() return; env->CallVoidMethod(obj.get(), m_javaGlue.m_rebuildWebTextView); checkException(env); + if (needNotMatchFocus) { + env->CallVoidMethod(obj.get(), m_javaGlue.m_setOkayToNotMatch); + checkException(env); + } } void displaySoftKeyboard(bool isTextView) @@ -1455,7 +1462,7 @@ static jobject nativeCursorPosition(JNIEnv *env, jobject obj) const CachedRoot* root = view->getFrameCache(WebView::DontAllowNewer); WebCore::IntPoint pos = WebCore::IntPoint(0, 0); if (root) - root->getSimulatedMousePosition(&pos); + root->getSimulatedMousePosition(root->currentCursor(), &pos); jclass pointClass = env->FindClass("android/graphics/Point"); jmethodID init = env->GetMethodID(pointClass, "<init>", "(II)V"); jobject point = env->NewObject(pointClass, init, pos.x(), pos.y()); @@ -1922,11 +1929,12 @@ static void nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj) root->setCursor(const_cast<CachedFrame*>(frame), const_cast<CachedNode*>(next)); WebCore::IntPoint pos; - root->getSimulatedMousePosition(&pos); + root->getSimulatedMousePosition(next, &pos); view->sendMoveMouse(static_cast<WebCore::Frame*>(frame->framePointer()), static_cast<WebCore::Node*>(next->nodePointer()), pos.x(), pos.y()); view->scrollRectOnScreen(bounds.x(), bounds.y(), bounds.right(), bounds.bottom()); + view->getWebViewCore()->m_moveGeneration++; } static jint nativeTextFieldAction(JNIEnv *env, jobject obj) |