am d9ec29f6: fix text area insertion order, partially
Merge commit 'd9ec29f64827bc703a23b1c33d653906a91713fc' into eclair-mr2-plus-aosp * commit 'd9ec29f64827bc703a23b1c33d653906a91713fc': fix text area insertion order, partially
This commit is contained in:
@@ -88,6 +88,7 @@ import java.util.ArrayList;
|
|||||||
// happens, the next time the user hits a key it is okay for the focus
|
// happens, the next time the user hits a key it is okay for the focus
|
||||||
// pointer to not match the WebTextView's node pointer
|
// pointer to not match the WebTextView's node pointer
|
||||||
boolean mOkayForFocusNotToMatch;
|
boolean mOkayForFocusNotToMatch;
|
||||||
|
boolean mResendKeyDown;
|
||||||
// Whether or not a selection change was generated from webkit. If it was,
|
// Whether or not a selection change was generated from webkit. If it was,
|
||||||
// we do not need to pass the selection back to webkit.
|
// we do not need to pass the selection back to webkit.
|
||||||
private boolean mFromWebKit;
|
private boolean mFromWebKit;
|
||||||
@@ -136,10 +137,9 @@ import java.util.ArrayList;
|
|||||||
isArrowKey = true;
|
isArrowKey = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isArrowKey && !mOkayForFocusNotToMatch
|
if (!isArrowKey && !mOkayForFocusNotToMatch && !mResendKeyDown
|
||||||
&& mWebView.nativeFocusNodePointer() != mNodePointer) {
|
&& mWebView.nativeFocusNodePointer() != mNodePointer) {
|
||||||
if (mWebView.nativeCursorNodePointer() == mNodePointer) {
|
if (mWebView.nativeFocusNodePointer() != 0) {
|
||||||
// remove cursor so character doesn't go back to this view
|
|
||||||
mWebView.nativeClearCursor();
|
mWebView.nativeClearCursor();
|
||||||
}
|
}
|
||||||
// Do not call remove() here, which hides the soft keyboard. If
|
// Do not call remove() here, which hides the soft keyboard. If
|
||||||
@@ -152,7 +152,7 @@ import java.util.ArrayList;
|
|||||||
// After a jump to next textfield and the first key press, the cursor
|
// After a jump to next textfield and the first key press, the cursor
|
||||||
// and focus will once again match, so reset this value.
|
// and focus will once again match, so reset this value.
|
||||||
mOkayForFocusNotToMatch = false;
|
mOkayForFocusNotToMatch = false;
|
||||||
|
mResendKeyDown = false;
|
||||||
Spannable text = (Spannable) getText();
|
Spannable text = (Spannable) getText();
|
||||||
int oldLength = text.length();
|
int oldLength = text.length();
|
||||||
// Normally the delete key's dom events are sent via onTextChanged.
|
// Normally the delete key's dom events are sent via onTextChanged.
|
||||||
|
|||||||
@@ -3380,6 +3380,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
rebuildWebTextView();
|
rebuildWebTextView();
|
||||||
// Now we need to pass the event to it
|
// Now we need to pass the event to it
|
||||||
if (inEditingMode()) {
|
if (inEditingMode()) {
|
||||||
|
mWebTextView.mResendKeyDown = true;
|
||||||
return mWebTextView.onKeyDown(keyCode, event);
|
return mWebTextView.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
} else if (nativeHasFocusNode()) {
|
} else if (nativeHasFocusNode()) {
|
||||||
@@ -4950,6 +4951,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
int select = nativeFocusCandidateIsTextField() ?
|
int select = nativeFocusCandidateIsTextField() ?
|
||||||
nativeFocusCandidateMaxLength() : 0;
|
nativeFocusCandidateMaxLength() : 0;
|
||||||
setSelection(select, select);
|
setSelection(select, select);
|
||||||
|
mWebTextView.mOkayForFocusNotToMatch = false; // only once
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WebViewCore.JSKeyData arg = new WebViewCore.JSKeyData();
|
WebViewCore.JSKeyData arg = new WebViewCore.JSKeyData();
|
||||||
|
|||||||
Reference in New Issue
Block a user