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

Commit 327dce9e authored by Grace Kloba's avatar Grace Kloba
Browse files

Make sure when WebView modified mScrollX/Y directly,

onScrollChanged() is called so that the View system
can do what it needs to adjust.

As WebView's onScrollChanged will call sendOurVisibleRect(),
we don't need to call it explicitly any more.

Fix http://b/issue?id=2438457
parent 61c3a13e
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -2066,7 +2066,7 @@ public class WebView extends AbsoluteLayout
                mScrollX = pinLocX(mScrollX);
                mScrollY = pinLocY(mScrollY);
                if (oldX != mScrollX || oldY != mScrollY) {
                    sendOurVisibleRect();
                    onScrollChanged(mScrollX, mScrollY, oldX, oldY);
                }
                if (!mScroller.isFinished()) {
                    // We are in the middle of a scroll.  Repin the final scroll
@@ -2130,9 +2130,12 @@ public class WebView extends AbsoluteLayout
                mScrollX = pinLocX(Math.round(sx));
                mScrollY = pinLocY(Math.round(sy));

                if (oldX != mScrollX || oldY != mScrollY) {
                    onScrollChanged(mScrollX, mScrollY, oldX, oldY);
                }

                // update webkit
                sendViewSizeZoom();
                sendOurVisibleRect();
            }
        }
    }
@@ -2634,9 +2637,7 @@ public class WebView extends AbsoluteLayout
            mScrollY = mScroller.getCurrY();
            postInvalidate();  // So we draw again
            if (oldX != mScrollX || oldY != mScrollY) {
                // As onScrollChanged() is not called, sendOurVisibleRect()
                // needs to be called explicitly.
                sendOurVisibleRect();
                onScrollChanged(mScrollX, mScrollY, oldX, oldY);
            }
        } else {
            super.computeScroll();
@@ -3347,10 +3348,12 @@ public class WebView extends AbsoluteLayout
                mUserScroll = false;
                mWebViewCore.sendMessage(EventHub.SYNC_SCROLL, oldScrollX,
                        oldScrollY);
            }
                onScrollChanged(mScrollX, mScrollY, oldScrollX, oldScrollY);
            } else {
                sendOurVisibleRect();
            }
        }
    }

    WebViewCore.CursorData cursorData() {
        WebViewCore.CursorData result = new WebViewCore.CursorData();