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

Commit 9b24dad7 authored by John Reck's avatar John Reck
Browse files

Initial support for keyboard navigation

 Bug: 6019693

Change-Id: I8d29a5cb46fc59bb2f53e8d334bc767b5ed16901
parent 8181201c
Loading
Loading
Loading
Loading
+29 −27
Original line number Diff line number Diff line
@@ -5555,7 +5555,7 @@ public class WebView extends AbsoluteLayout
            return false;
        }

        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
        if (isEnterActionKey(keyCode)) {
            switchOutDrawHistory();
            boolean wantsKeyEvents = nativeCursorNodePointer() == 0
                || nativeCursorWantsKeyEvents();
@@ -5704,6 +5704,7 @@ public class WebView extends AbsoluteLayout
                return true; // discard press if copy in progress
            }

            if (!sDisableNavcache) {
                // perform the single click
                Rect visibleRect = sendOurVisibleRect();
                // Note that sendOurVisibleRect calls viewToContent, so the
@@ -5733,6 +5734,7 @@ public class WebView extends AbsoluteLayout
                    return true;
                }
            }
        }

        // TODO: should we pass all the keys to DOM or check the meta tag
        if (nativeCursorWantsKeyEvents() || true) {
+9 −4
Original line number Diff line number Diff line
@@ -332,6 +332,15 @@ public final class WebViewCore {
                nodePointer, 0).sendToTarget();
    }

    /**
     * Called by JNI when the focus node changed.
     */
    private void focusNodeChanged(WebKitHitTest hitTest) {
        if (mWebView == null) return;
        mWebView.mPrivateHandler.obtainMessage(WebView.HIT_TEST_RESULT, hitTest)
                .sendToTarget();
    }

    /**
     * Called by JNI.  Open a file chooser to upload a file.
     * @param acceptType The value of the 'accept' attribute of the
@@ -614,7 +623,6 @@ public final class WebViewCore {
            int x, int y);
    private native String nativeRetrieveImageSource(int nativeClass,
            int x, int y);
    private native void nativeStopPaintingCaret(int nativeClass);
    private native void nativeTouchUp(int nativeClass,
            int touchGeneration, int framePtr, int nodePtr, int x, int y);

@@ -1530,9 +1538,6 @@ public final class WebViewCore {
                            nativeMoveMouseIfLatest(mNativeClass,
                                    cData.mMoveGeneration,
                                    cData.mFrame, cData.mX, cData.mY);
                            if (msg.arg1 == 1) {
                                nativeStopPaintingCaret(mNativeClass);
                            }
                            break;

                        case REQUEST_CURSOR_HREF: {