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

Commit 45dee41f authored by Grace Kloba's avatar Grace Kloba Committed by The Android Open Source Project
Browse files

AI 144661: Fix #175030. Preserve the zoom factor during refresh. Remove the...

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
parent 0bd928ff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+5 −2
Original line number Diff line number Diff line
@@ -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();
            }