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

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

rebuild the nav cache if the clicked on node is invalid

Rebuild the nav cache in the webkit thread after determining
that the clicked on node isn't valid. Remove old code that
passed a flag to avoid using the invalid node, since it
should always be valid now.

requires a companion fix in external/webkit

fixes http://b/2362334
parent f523609e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5129,12 +5129,12 @@ public class WebView extends AbsoluteLayout
            mWebViewCore.sendMessageAtFrontOfQueue(EventHub.VALID_NODE_BOUNDS,
                    motionUpData);
        } else {
            doMotionUp(contentX, contentY, false);
            doMotionUp(contentX, contentY);
        }
    }

    private void doMotionUp(int contentX, int contentY, boolean useNavCache) {
        if (nativeMotionUp(contentX, contentY, useNavCache ? mNavSlop : 0)) {
    private void doMotionUp(int contentX, int contentY) {
        if (nativeMotionUp(contentX, contentY, mNavSlop)) {
            if (mLogEvent) {
                Checkin.updateStats(mContext.getContentResolver(),
                        Checkin.Stats.Tag.BROWSER_SNAP_CENTER, 1, 0.0);
@@ -5763,7 +5763,7 @@ public class WebView extends AbsoluteLayout
                    break;

                case DO_MOTION_UP:
                    doMotionUp(msg.arg1, msg.arg2, (Boolean) msg.obj);
                    doMotionUp(msg.arg1, msg.arg2);
                    break;

                case SHOW_FULLSCREEN:
+5 −4
Original line number Diff line number Diff line
@@ -1316,13 +1316,14 @@ final class WebViewCore {

                        case VALID_NODE_BOUNDS: {
                            MotionUpData motionUpData = (MotionUpData) msg.obj;
                            boolean result = nativeValidNodeAndBounds(
                            if (!nativeValidNodeAndBounds(
                                    motionUpData.mFrame, motionUpData.mNode,
                                    motionUpData.mBounds);
                                    motionUpData.mBounds)) {
                                nativeUpdateFrameCache();
                            }
                            Message message = mWebView.mPrivateHandler
                                    .obtainMessage(WebView.DO_MOTION_UP,
                                    motionUpData.mX, motionUpData.mY,
                                    new Boolean(result));
                                    motionUpData.mX, motionUpData.mY);
                            mWebView.mPrivateHandler.sendMessageAtFrontOfQueue(
                                    message);
                            break;