diff options
author | George Mount <mount@google.com> | 2012-03-15 16:39:16 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2012-03-15 16:43:14 -0700 |
commit | c6c549d8d2eb30c66e43d6559a35ee1a07c58e68 (patch) | |
tree | 420b173583e67c9d65586ba82d75b9e93885e8aa | |
parent | 590924e10a39347e2375a2e4f96be95883637be4 (diff) | |
download | frameworks_base-c6c549d8d2eb30c66e43d6559a35ee1a07c58e68.zip frameworks_base-c6c549d8d2eb30c66e43d6559a35ee1a07c58e68.tar.gz frameworks_base-c6c549d8d2eb30c66e43d6559a35ee1a07c58e68.tar.bz2 |
Update edit text size when the text changes so scroll works.
Bug 6176413
Webkit Change: I487322ca9578c003f937b92ca4e8d46d34ea8c78
Change-Id: I6b8f244cd747d6d19c261d685a3cfb9ef4d71ec3
-rw-r--r-- | core/java/android/webkit/WebViewClassic.java | 7 | ||||
-rw-r--r-- | core/java/android/webkit/WebViewCore.java | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index 4c9e10c..ed43043 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -1254,6 +1254,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc static final int FOCUS_NODE_CHANGED = 147; static final int AUTOFILL_FORM = 148; static final int ANIMATE_TEXT_SCROLL = 149; + static final int EDIT_TEXT_SIZE_CHANGED = 150; private static final int FIRST_PACKAGE_MSG_ID = SCROLL_TO_MSG_ID; private static final int LAST_PACKAGE_MSG_ID = HIT_TEST_RESULT; @@ -8504,6 +8505,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc computeEditTextScroll(); break; + case EDIT_TEXT_SIZE_CHANGED: + if (msg.arg1 == mFieldPointer) { + mEditTextContent.set((Rect)msg.obj); + } + break; + default: super.handleMessage(msg); break; diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index d0ebdd4..d784b08 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -2779,6 +2779,18 @@ public final class WebViewCore { } // called by JNI + private void updateTextSizeAndScroll(int pointer, int width, int height, + int scrollX, int scrollY) { + if (mWebView != null) { + Rect rect = new Rect(-scrollX, -scrollY, width - scrollX, + height - scrollY); + Message.obtain(mWebView.mPrivateHandler, + WebViewClassic.EDIT_TEXT_SIZE_CHANGED, pointer, 0, rect) + .sendToTarget(); + } + } + + // called by JNI private void clearTextEntry() { if (mWebView == null) return; Message.obtain(mWebView.mPrivateHandler, |