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

Commit 99415605 authored by Shimeng (Simon) Wang's avatar Shimeng (Simon) Wang
Browse files

Use fixed viewport for all devices in wide viewport mode.

This will simplify viewport logic; and currently Clank behaves
the same for phones.

issue: 4343683
Change-Id: Icddc23cd5b12f9820c611dbf66c9772f147baf4b
parent 970ce730
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -183,7 +183,6 @@ public class WebSettings {
    private boolean         mJavaScriptCanOpenWindowsAutomatically = false;
    private boolean         mUseDoubleTree = false;
    private boolean         mUseWideViewport = false;
    private boolean         mUseFixedViewport = false;
    private boolean         mSupportMultipleWindows = false;
    private boolean         mShrinksStandaloneImagesToFit = false;
    private long            mMaximumDecodedImageSize = 0; // 0 means default
@@ -383,13 +382,6 @@ public class WebSettings {
        mDefaultTextEncoding = context.getString(com.android.internal.
                                                 R.string.default_text_encoding);

        // Detect tablet device for fixed viewport mode.
        final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        final int landscapeWidth = Math.max(metrics.widthPixels, metrics.heightPixels);
        final int minTabletWidth = context.getResources().getDimensionPixelSize(
            com.android.internal.R.dimen.min_xlarge_screen_width);
        mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= minTabletWidth);

        if (sLockForLocaleSettings == null) {
            sLockForLocaleSettings = new Object();
            sLocale = Locale.getDefault();
@@ -1652,11 +1644,11 @@ public class WebSettings {
    }

    /**
     * Returns whether to use fixed viewport.  Fixed viewport should operate only
     * when wide viewport is on.
     * Returns whether to use fixed viewport.  Use fixed viewport
     * whenever wide viewport is on.
     */
    /* package */ boolean getUseFixedViewport() {
        return getUseWideViewPort() && mUseFixedViewport;
        return getUseWideViewPort();
    }

    /**