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

Commit 0df02698 authored by Cary Clark's avatar Cary Clark
Browse files

defer resume while selecting text

Allow scrolling, dragging, zooming to process normally
while selecting text, but prevent them from resuming
the webkit update until the selection is done.

Also, resume the webkit priority when resuming the
updates.

bug:3226364
Change-Id: Idfad6b63b6eb02208f977d89a8409377e9d731e7
parent 93fbae34
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -3053,8 +3053,10 @@ public class WebView extends AbsoluteLayout
                abortAnimation();
                mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
                WebViewCore.resumePriority();
                if (!mSelectingText) {
                    WebViewCore.resumeUpdatePicture(mWebViewCore);
                }
            }
        } else {
            super.computeScroll();
        }
@@ -3818,7 +3820,9 @@ public class WebView extends AbsoluteLayout
    }

    void onFixedLengthZoomAnimationEnd() {
        if (!mSelectingText) {
            WebViewCore.resumeUpdatePicture(mWebViewCore);
        }
        onZoomAnimationEnd();
    }

@@ -4647,6 +4651,7 @@ public class WebView extends AbsoluteLayout
            // called by mSelectCallback.onDestroyActionMode
            mSelectCallback.finish();
            mSelectCallback = null;
            WebViewCore.resumePriority();
            WebViewCore.resumeUpdatePicture(mWebViewCore);
            invalidate(); // redraw without selection
        }
@@ -5552,7 +5557,9 @@ public class WebView extends AbsoluteLayout
                        // is possible on emulator.
                        mLastVelocity = 0;
                        WebViewCore.resumePriority();
                        if (!mSelectingText) {
                            WebViewCore.resumeUpdatePicture(mWebViewCore);
                        }
                        break;
                }
                stopTouch();
@@ -5681,8 +5688,8 @@ public class WebView extends AbsoluteLayout
            mVelocityTracker = null;
        }

        if (mTouchMode == TOUCH_DRAG_MODE ||
                mTouchMode == TOUCH_DRAG_LAYER_MODE) {
        if ((mTouchMode == TOUCH_DRAG_MODE
                || mTouchMode == TOUCH_DRAG_LAYER_MODE) && !mSelectingText) {
            WebViewCore.resumePriority();
            WebViewCore.resumeUpdatePicture(mWebViewCore);
        }
@@ -6053,7 +6060,9 @@ public class WebView extends AbsoluteLayout
        }
        if ((maxX == 0 && vy == 0) || (maxY == 0 && vx == 0)) {
            WebViewCore.resumePriority();
            if (!mSelectingText) {
                WebViewCore.resumeUpdatePicture(mWebViewCore);
            }
            if (mScroller.springBack(mScrollX, mScrollY, 0, computeMaxScrollX(),
                    0, computeMaxScrollY())) {
                invalidate();