Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6c549d8 authored by George Mount's avatar George Mount
Browse files

Update edit text size when the text changes so scroll works.

 Bug 6176413
 Webkit Change: I487322ca9578c003f937b92ca4e8d46d34ea8c78

Change-Id: I6b8f244cd747d6d19c261d685a3cfb9ef4d71ec3
parent 590924e1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
+12 −0
Original line number Diff line number Diff line
@@ -2778,6 +2778,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;