summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-07-27 15:46:44 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-27 15:46:44 -0700
commit24f2936d352e8938a02ec10ace57cac8671fc68f (patch)
tree3ad05f4b201aa1b541341183c735d0aa42b47b8d /core/java/android/webkit/WebView.java
parente1b925919096b27a1592665ed09fb8ac874273e3 (diff)
parente3e7a88b4d83d46be5a6c766dc4340cd1687d693 (diff)
downloadframeworks_base-24f2936d352e8938a02ec10ace57cac8671fc68f.zip
frameworks_base-24f2936d352e8938a02ec10ace57cac8671fc68f.tar.gz
frameworks_base-24f2936d352e8938a02ec10ace57cac8671fc68f.tar.bz2
Merge "Use WebTextView overlay to render text fields/areas much faster"
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java73
1 files changed, 22 insertions, 51 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index e24ab58..a935a67 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4068,9 +4068,6 @@ public class WebView extends AbsoluteLayout
if (AUTO_REDRAW_HACK && mAutoRedraw) {
invalidate();
}
- if (inEditingMode()) {
- mWebTextView.onDrawSubstitute();
- }
mWebViewCore.signalRepaintDone();
if (mOverScrollGlow != null && mOverScrollGlow.drawEdgeGlows(canvas)) {
@@ -4287,18 +4284,18 @@ public class WebView extends AbsoluteLayout
private void onZoomAnimationStart() {
// If it is in password mode, turn it off so it does not draw misplaced.
- if (inEditingMode() && nativeFocusCandidateIsPassword()) {
- mWebTextView.setInPassword(false);
+ if (inEditingMode()) {
+ mWebTextView.setVisibility(INVISIBLE);
}
}
private void onZoomAnimationEnd() {
// adjust the edit text view if needed
- if (inEditingMode() && didUpdateWebTextViewDimensions(FULLY_ON_SCREEN)
- && nativeFocusCandidateIsPassword()) {
+ if (inEditingMode()
+ && didUpdateWebTextViewDimensions(FULLY_ON_SCREEN)) {
// If it is a password field, start drawing the WebTextView once
// again.
- mWebTextView.setInPassword(true);
+ mWebTextView.setVisibility(VISIBLE);
}
}
@@ -4593,37 +4590,23 @@ public class WebView extends AbsoluteLayout
}
String text = nativeFocusCandidateText();
int nodePointer = nativeFocusCandidatePointer();
- if (alreadyThere && mWebTextView.isSameTextField(nodePointer)) {
- // It is possible that we have the same textfield, but it has moved,
- // i.e. In the case of opening/closing the screen.
- // In that case, we need to set the dimensions, but not the other
- // aspects.
- // If the text has been changed by webkit, update it. However, if
- // there has been more UI text input, ignore it. We will receive
- // another update when that text is recognized.
- if (text != null && !text.equals(mWebTextView.getText().toString())
- && nativeTextGeneration() == mTextGeneration) {
- mWebTextView.setTextAndKeepSelection(text);
- }
- } else {
- mWebTextView.setGravity(nativeFocusCandidateIsRtlText() ?
- Gravity.RIGHT : Gravity.NO_GRAVITY);
- // This needs to be called before setType, which may call
- // requestFormData, and it needs to have the correct nodePointer.
- mWebTextView.setNodePointer(nodePointer);
- mWebTextView.setType(nativeFocusCandidateType());
- updateWebTextViewPadding();
- if (null == text) {
- if (DebugFlags.WEB_VIEW) {
- Log.v(LOGTAG, "rebuildWebTextView null == text");
- }
- text = "";
- }
- mWebTextView.setTextAndKeepSelection(text);
- InputMethodManager imm = InputMethodManager.peekInstance();
- if (imm != null && imm.isActive(mWebTextView)) {
- imm.restartInput(mWebTextView);
+ mWebTextView.setGravity(nativeFocusCandidateIsRtlText() ?
+ Gravity.RIGHT : Gravity.NO_GRAVITY);
+ // This needs to be called before setType, which may call
+ // requestFormData, and it needs to have the correct nodePointer.
+ mWebTextView.setNodePointer(nodePointer);
+ mWebTextView.setType(nativeFocusCandidateType());
+ updateWebTextViewPadding();
+ if (null == text) {
+ if (DebugFlags.WEB_VIEW) {
+ Log.v(LOGTAG, "rebuildWebTextView null == text");
}
+ text = "";
+ }
+ mWebTextView.setTextAndKeepSelection(text);
+ InputMethodManager imm = InputMethodManager.peekInstance();
+ if (imm != null && imm.isActive(mWebTextView)) {
+ imm.restartInput(mWebTextView);
}
if (isFocused()) {
mWebTextView.requestFocus();
@@ -8120,19 +8103,7 @@ public class WebView extends AbsoluteLayout
// and representing the same node as the pointer.
if (inEditingMode() &&
mWebTextView.isSameTextField(msg.arg1)) {
- if (msg.getData().getBoolean("password")) {
- Spannable text = (Spannable) mWebTextView.getText();
- int start = Selection.getSelectionStart(text);
- int end = Selection.getSelectionEnd(text);
- mWebTextView.setInPassword(true);
- // Restore the selection, which may have been
- // ruined by setInPassword.
- Spannable pword =
- (Spannable) mWebTextView.getText();
- Selection.setSelection(pword, start, end);
- // If the text entry has created more events, ignore
- // this one.
- } else if (msg.arg2 == mTextGeneration) {
+ if (msg.arg2 == mTextGeneration) {
String text = (String) msg.obj;
if (null == text) {
text = "";