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

Commit e84a0db0 authored by Cary Clark's avatar Cary Clark
Browse files

simplify utility to hit-test focused plugin

After about 4 taps, this starts to return that the tap was
in the plugin. Before that, the plugin doesn't have focus.
Derek may want to verify that everything is working as it
should -- maybe it just takes that long for webkit to take
focus.

companion fix in external/webkit

Change-Id: I80ffba6c55876b0af9c305c539a10e8e8ed7cb3c
http://b/2521087
parent 26aa68c6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -4521,9 +4521,14 @@ public class WebView extends AbsoluteLayout
    }

    private boolean hitFocusedPlugin(int contentX, int contentY) {
        if (DebugFlags.WEB_VIEW) {
            Log.v(LOGTAG, "nativeFocusIsPlugin()=" + nativeFocusIsPlugin());
            Rect r = nativeFocusNodeBounds();
            Log.v(LOGTAG, "nativeFocusNodeBounds()=(" + r.left + ", " + r.top
                    + ", " + r.right + ", " + r.bottom + ")");
        }
        return nativeFocusIsPlugin()
                && nativePointInNavCache(contentX, contentY, mNavSlop)
                && nativeCacheHitNodePointer() == nativeFocusNodePointer();
                && nativeFocusNodeBounds().contains(contentX, contentY);
    }

    private boolean shouldForwardTouchEvent() {
@@ -7169,6 +7174,7 @@ public class WebView extends AbsoluteLayout
     */
    private native int      nativeFocusCandidateType();
    private native boolean  nativeFocusIsPlugin();
    private native Rect     nativeFocusNodeBounds();
    /* package */ native int nativeFocusNodePointer();
    private native Rect     nativeGetCursorRingBounds();
    private native String   nativeGetSelection();