AI 144661: Fix #175030. Preserve the zoom factor during refresh. Remove the code change in FrameLoader.cpp which was to preserve the zoom factor when we first did layout. Now we only use the initialZoomScale if it is a standard load. If it is history load, restoreScale() should be called before didFirstLayout(), in the other cases, like reload, refresh, replace, we don't change the zoom factor.

BUG=175030

Automated import of CL 144661
This commit is contained in:
Grace Kloba
2009-04-06 10:47:26 -07:00
committed by The Android Open Source Project
parent 0bd928fff7
commit 45dee41f5c
2 changed files with 6 additions and 2 deletions

View File

@@ -4654,6 +4654,7 @@ public class WebView extends AbsoluteLayout
if (mInitialScale > 0) {
scale = mInitialScale / 100.0f;
} else {
if (initialScale < 0) break;
if (mWebViewCore.getSettings().getUseWideViewPort()) {
// force viewSizeChanged by setting mLastWidthSent
// to 0

View File

@@ -1518,7 +1518,7 @@ final class WebViewCore {
private native void setViewportSettingsFromNative();
// called by JNI
private void didFirstLayout() {
private void didFirstLayout(boolean standardLoad) {
// Trick to ensure that the Picture has the exact height for the content
// by forcing to layout with 0 height after the page is ready, which is
// indicated by didFirstLayout. This is essential to get rid of the
@@ -1584,8 +1584,11 @@ final class WebViewCore {
scaleLimit).sendToTarget();
mRestoredScale = 0;
} else {
// if standardLoad is true, use mViewportInitialScale, otherwise
// pass -1 to the WebView to indicate no change of the scale.
Message.obtain(mWebView.mPrivateHandler,
WebView.DID_FIRST_LAYOUT_MSG_ID, mViewportInitialScale,
WebView.DID_FIRST_LAYOUT_MSG_ID,
standardLoad ? mViewportInitialScale : -1,
mViewportWidth, scaleLimit).sendToTarget();
}