summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebTextView.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-12-15 16:38:45 -0500
committerLeon Scroggins <scroggo@google.com>2010-01-04 09:43:57 -0500
commite26efa321c66716d58f3e338022caed8852af07e (patch)
tree0d0fce57cb48369886a22c47ac56b9e5d9a6014b /core/java/android/webkit/WebTextView.java
parent4bc95d19c9ccf9cfe4c51b1e697db8cc1d86a579 (diff)
downloadframeworks_base-e26efa321c66716d58f3e338022caed8852af07e.zip
frameworks_base-e26efa321c66716d58f3e338022caed8852af07e.tar.gz
frameworks_base-e26efa321c66716d58f3e338022caed8852af07e.tar.bz2
If the DOM changes textfield focus, make the IME work properly.
Fix for http://b/issue?id=2219166 Requires a change to external/webkit Remove the old change to update the WebTextView when a key is pressed, since the IME does not generate key events. Instead, when the focus changes, and the IME is serving the WebTextView, immediately clear the cursor and update the WebTextView, so the user can continue typing.
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
-rw-r--r--core/java/android/webkit/WebTextView.java23
1 files changed, 0 insertions, 23 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 92da456..9a36798 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -84,12 +84,6 @@ import java.util.ArrayList;
// True if the most recent drag event has caused either the TextView to
// scroll or the web page to scroll. Gets reset after a touch down.
private boolean mScrolled;
- // Gets set to true any time the WebTextView has focus, but the navigation
- // cache does not yet know that the focus has been changed. This happens
- // if the user presses "Next", if the user moves the cursor to a textfield
- // and starts typing or clicks the trackball/center key, and when the user
- // touches a textfield.
- boolean mOkayForFocusNotToMatch;
// Whether or not a selection change was generated from webkit. If it was,
// we do not need to pass the selection back to webkit.
private boolean mFromWebKit;
@@ -151,22 +145,6 @@ import java.util.ArrayList;
break;
}
- if (down) {
- if (mOkayForFocusNotToMatch) {
- if (mWebView.nativeFocusNodePointer() == mNodePointer) {
- mOkayForFocusNotToMatch = false;
- }
- } else if (mWebView.nativeFocusNodePointer() != mNodePointer
- && !isArrowKey) {
- mWebView.nativeClearCursor();
- // Do not call remove() here, which hides the soft keyboard. If
- // the soft keyboard is being displayed, the user will still want
- // it there.
- mWebView.removeView(this);
- mWebView.requestFocus();
- return mWebView.dispatchKeyEvent(event);
- }
- }
Spannable text = (Spannable) getText();
int oldLength = text.length();
// Normally the delete key's dom events are sent via onTextChanged.
@@ -324,7 +302,6 @@ import java.util.ArrayList;
// focus, set the focus controller back to inactive
mWebView.setFocusControllerInactive();
mWebView.nativeMoveCursorToNextTextInput();
- mOkayForFocusNotToMatch = true;
// Preemptively rebuild the WebTextView, so that the action will
// be set properly.
mWebView.rebuildWebTextView();