summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-07-02 10:40:58 -0400
committerLeon Scroggins <scroggo@google.com>2009-07-06 11:14:56 -0400
commit539427bc7572dfd8b28579c67460186406dcb246 (patch)
tree873bb1a67b9a1ec74533a94ed3d40610b6ced77a /WebKit
parent3f84acc12c5a694d9c4073aa1de33fbdf1cd22d1 (diff)
downloadexternal_webkit-539427bc7572dfd8b28579c67460186406dcb246.zip
external_webkit-539427bc7572dfd8b28579c67460186406dcb246.tar.gz
external_webkit-539427bc7572dfd8b28579c67460186406dcb246.tar.bz2
In WebTextView, check the focus before sending a key.
This fixes a bug where the DOM has moved the focus, but the WebTextView is still sending keys to the old focus. Requires a change in frameworks/base. This part of the change just gives WebView a way to get a pointer to the currently focused node (regardless of the cursor).
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/WebView.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 56570a6..78b7c72 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -1645,6 +1645,12 @@ static jint nativeFocusCandidateTextSize(JNIEnv *env, jobject obj)
return node ? node->textSize() : 0;
}
+static jint nativeFocusNodePointer(JNIEnv *env, jobject obj)
+{
+ const CachedNode* node = getFocusNode(env, obj);
+ return node ? reinterpret_cast<int>(node->nodePointer()) : 0;
+}
+
static bool nativeCursorWantsKeyEvents(JNIEnv* env, jobject jwebview) {
WebView* view = GET_NATIVE_VIEW(env, jwebview);
LOG_ASSERT(view, "view not set in %s", __FUNCTION__);
@@ -1977,6 +1983,8 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeFocusCandidateText },
{ "nativeFocusCandidateTextSize", "()I",
(void*) nativeFocusCandidateTextSize },
+ { "nativeFocusNodePointer", "()I",
+ (void*) nativeFocusNodePointer },
{ "nativeGetCursorRingBounds", "()Landroid/graphics/Rect;",
(void*) nativeGetCursorRingBounds },
{ "nativeGetSelection", "()Landroid/graphics/Region;",