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

Commit 5c44fee5 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Improve when highlight rects are shown"

parents f21bea24 2d8c13bd
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -6002,9 +6002,9 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                    data.mNativeLayer = nativeScrollableLayer(
                            contentX, contentY, data.mNativeLayerRect, null);
                    data.mSlop = viewToContentDimension(mNavSlop);
                    mTouchHighlightRegion.setEmpty();
                    removeTouchHighlight();
                    if (!mBlockWebkitViewMessages) {
                        mTouchHighlightRequested = System.currentTimeMillis();
                        mTouchHighlightRequested = SystemClock.uptimeMillis();
                        mWebViewCore.sendMessageAtFrontOfQueue(
                                EventHub.HIT_TEST, data);
                    }
@@ -7777,13 +7777,16 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
        if (mFocusedNode.mHasFocus && mFocusedNode.mEditable) {
            return false;
        }
        long delay = System.currentTimeMillis() - mTouchHighlightRequested;
        long delay = SystemClock.uptimeMillis() - mTouchHighlightRequested;
        if (delay < ViewConfiguration.getTapTimeout()) {
            Rect r = mTouchHighlightRegion.getBounds();
            mWebView.postInvalidateDelayed(delay, r.left, r.top, r.right, r.bottom);
            return false;
        }
        return true;
        if (mInputDispatcher == null) {
            return false;
        }
        return mInputDispatcher.shouldShowTapHighlight();
    }


+6 −0
Original line number Diff line number Diff line
@@ -349,6 +349,12 @@ final class WebViewInputDispatcher {
        }
    }

    public boolean shouldShowTapHighlight() {
        synchronized (mLock) {
            return mPostLongPressScheduled || mPostClickScheduled;
        }
    }

    private void postLongPress() {
        synchronized (mLock) {
            if (!mPostLongPressScheduled) {