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

Commit 6f2db8e7 authored by Mangesh Ghiware's avatar Mangesh Ghiware
Browse files

Fix issue with site-specific display density getting stuck.

This issue was found while investigating b/5328288.

After navigating to a page that specifies target-densitydpi in the
viewport meta tag, this density value wasn't reset to the default value
for a page that didn't.

Change-Id: I1a66dab769026367224ecf4cc28bc033ee97e475
parent 3c673732
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -2338,11 +2338,7 @@ public final class WebViewCore {
        // adjust the default scale to match the densityDpi
        float adjust = 1.0f;
        if (mViewportDensityDpi == -1) {
            // convert default zoom scale to a integer (percentage) to avoid any
            // issues with floating point comparisons
            if (mWebView != null && (int)(mWebView.getDefaultZoomScale() * 100) != 100) {
                adjust = mWebView.getDefaultZoomScale();
            }
            adjust = mContext.getResources().getDisplayMetrics().density;
        } else if (mViewportDensityDpi > 0) {
            adjust = (float) mContext.getResources().getDisplayMetrics().densityDpi
                    / mViewportDensityDpi;