diff options
author | Leon Scroggins <scroggo@google.com> | 2011-02-24 12:34:42 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2011-02-24 13:23:59 -0500 |
commit | 94f12574c74b11db011b994e462f64a112952a47 (patch) | |
tree | 257473b2429f11621095d5c7c43c9b175bb0954f /WebKit/android/nav | |
parent | 17c9af86d88ba238f6574f45cc821ce7e68d1fa1 (diff) | |
download | external_webkit-94f12574c74b11db011b994e462f64a112952a47.zip external_webkit-94f12574c74b11db011b994e462f64a112952a47.tar.gz external_webkit-94f12574c74b11db011b994e462f64a112952a47.tar.bz2 |
Stop the blinking caret when moving to another field.
Bug:2930013
Requires a change in frameworks/base.
Change-Id: I892fcdd9b9a0abdcf82e5bb26c930b68ae8b10fa
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 03263ef..4031439 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -148,7 +148,7 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl) : m_javaGlue.m_overrideLoading = GetJMethod(env, clazz, "overrideLoading", "(Ljava/lang/String;)V"); m_javaGlue.m_sendMoveFocus = GetJMethod(env, clazz, "sendMoveFocus", "(II)V"); m_javaGlue.m_sendMoveMouse = GetJMethod(env, clazz, "sendMoveMouse", "(IIII)V"); - m_javaGlue.m_sendMoveMouseIfLatest = GetJMethod(env, clazz, "sendMoveMouseIfLatest", "(Z)V"); + m_javaGlue.m_sendMoveMouseIfLatest = GetJMethod(env, clazz, "sendMoveMouseIfLatest", "(ZZ)V"); m_javaGlue.m_sendMotionUp = GetJMethod(env, clazz, "sendMotionUp", "(IIIII)V"); m_javaGlue.m_domChangedFocus = GetJMethod(env, clazz, "domChangedFocus", "()V"); m_javaGlue.m_getScaledMaxXScroll = GetJMethod(env, clazz, "getScaledMaxXScroll", "()I"); @@ -866,7 +866,9 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll) const CachedNode* focus = root->currentFocus(); bool clearTextEntry = cachedNode != focus && focus && cachedNode->nodePointer() != focus->nodePointer() && focus->isTextInput(); - sendMoveMouseIfLatest(clearTextEntry); + // Stop painting the caret if the old focus was a text input and so is the new cursor. + bool stopPaintingCaret = clearTextEntry && cachedNode->wantsKeyEvents(); + sendMoveMouseIfLatest(clearTextEntry, stopPaintingCaret); } else { int docHeight = root->documentHeight(); int docWidth = root->documentWidth(); @@ -942,7 +944,7 @@ void selectBestAt(const WebCore::IntRect& rect) root->setCursor(const_cast<CachedFrame*>(frame), const_cast<CachedNode*>(node)); } - sendMoveMouseIfLatest(false); + sendMoveMouseIfLatest(false, false); if (!node) return; } @@ -1208,12 +1210,12 @@ void sendMoveMouse(WebCore::Frame* framePtr, WebCore::Node* nodePtr, int x, int checkException(env); } -void sendMoveMouseIfLatest(bool clearTextEntry) +void sendMoveMouseIfLatest(bool clearTextEntry, bool stopPaintingCaret) { LOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!"); JNIEnv* env = JSC::Bindings::getJNIEnv(); env->CallVoidMethod(m_javaGlue.object(env).get(), - m_javaGlue.m_sendMoveMouseIfLatest, clearTextEntry); + m_javaGlue.m_sendMoveMouseIfLatest, clearTextEntry, stopPaintingCaret); checkException(env); } |