Bug 1689371 - Don't overwrite the dynamic toolbar height if we have set the pref value. r=botond
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Tue, 02 Feb 2021 02:47:31 +0000
changeset 565545 4b90835c5e07cdff39fee6a9bf8da55170cc394a
parent 565544 579a66fd796690fb752485215b2edaa6167ebf16
child 565546 529e8d67476588f5fa8c6b077a80f0a714d18073
push id38162
push usernerli@mozilla.com
push dateTue, 02 Feb 2021 09:51:07 +0000
treeherdermozilla-central@57bcdf857d44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1689371
milestone87.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1689371 - Don't overwrite the dynamic toolbar height if we have set the pref value. r=botond Otherwise on Android, we always use the toolbar height set by applications even if the pref was set (Note that GeckoView Test Runner doesn't have the dynamic toolbar thus the height is always 0). Differential Revision: https://phabricator.services.mozilla.com/D103611
layout/base/nsPresContext.cpp
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -701,17 +701,19 @@ nsresult nsPresContext::Init(nsDeviceCon
                                  gExactCallbackPrefs, this);
 
   nsresult rv = mEventManager->Init();
   NS_ENSURE_SUCCESS(rv, rv);
 
   mEventManager->SetPresContext(this);
 
 #if defined(MOZ_WIDGET_ANDROID)
-  if (IsRootContentDocumentCrossProcess()) {
+  if (IsRootContentDocumentCrossProcess() &&
+      MOZ_LIKELY(
+          !Preferences::HasUserValue("layout.dynamic-toolbar-max-height"))) {
     if (BrowserChild* browserChild =
             BrowserChild::GetFrom(mDocument->GetDocShell())) {
       mDynamicToolbarMaxHeight = browserChild->GetDynamicToolbarMaxHeight();
       mDynamicToolbarHeight = mDynamicToolbarMaxHeight;
     }
   }
 #endif