From d84e7d53d379c9fdfe335f40e89e2dfd6144dfea Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Tue, 29 Sep 2009 11:11:45 -0400 Subject: [PATCH] Allow scrolls to continue when getting a new content size. In recordNewContentSize, rather than aborting any scrolls in progress, find the final coordinates of the scroll and pin them to the new size, and let the scroll continue. Fixes http://b/issue?id=2141960 Change-Id: I7bfa444b52e70a0ca817221f379df77efc3496b7 --- core/java/android/webkit/WebView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 8858b81cb756b..eb6e0f1c18672 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1917,12 +1917,15 @@ public class WebView extends AbsoluteLayout int oldY = mScrollY; mScrollX = pinLocX(mScrollX); mScrollY = pinLocY(mScrollY); - // android.util.Log.d("skia", "recordNewContentSize - - // abortAnimation"); - abortAnimation(); // just in case if (oldX != mScrollX || oldY != mScrollY) { sendOurVisibleRect(); } + if (!mScroller.isFinished()) { + // We are in the middle of a scroll. Repin the final scroll + // position. + mScroller.setFinalX(pinLocX(mScroller.getFinalX())); + mScroller.setFinalY(pinLocY(mScroller.getFinalY())); + } } } contentSizeChanged(updateLayout);