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

Commit 2d8c13bd authored by John Reck's avatar John Reck
Browse files

Improve when highlight rects are shown

 Bug: 6319429

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




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


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

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