Bug 1573992 - Convert android.widget_paints_background to static pref. r=njn

Converts android.widget_paints_background to a static pref. From my understanding, this pref only matters on android, and the overridden function in nsIWidget defaults to `false`. Based on that I replaced the entire WidgetPaintsBackground() function with a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D42395

--HG--
extra : moz-landing-system : lando
This commit is contained in:
kriswright 2019-08-26 20:25:43 +00:00
parent c99009c207
commit 533fc20279
3 changed files with 17 additions and 11 deletions

View File

@ -178,6 +178,19 @@
value: false
mirror: always
#ifdef ANDROID
#---------------------------------------------------------------------------
# Prefs starting with "android."
#---------------------------------------------------------------------------
# On Android, we want an opaque background to be visible under the page,
# so layout should not force a default background.
- name: android.widget_paints_background
type: bool
value: true
mirror: always
#endif
#---------------------------------------------------------------------------
# Prefs starting with "apz."
# The apz prefs are explained in AsyncPanZoomController.cpp

View File

@ -81,7 +81,8 @@ pref_groups = [
]
if CONFIG['OS_TARGET'] == 'Android':
pref_groups += [
'consoleservice'
'android',
'consoleservice',
]
if CONFIG['FUZZING']:
pref_groups += [

View File

@ -15,6 +15,7 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/RWLock.h"
#include "mozilla/StaticPrefs_android.h"
#include "mozilla/StaticPrefs_ui.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/TypeTraits.h"
@ -2189,16 +2190,7 @@ nsresult nsWindow::SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
}
bool nsWindow::WidgetPaintsBackground() {
static bool sWidgetPaintsBackground = true;
static bool sWidgetPaintsBackgroundPrefCached = false;
if (!sWidgetPaintsBackgroundPrefCached) {
sWidgetPaintsBackgroundPrefCached = true;
mozilla::Preferences::AddBoolVarCache(
&sWidgetPaintsBackground, "android.widget_paints_background", true);
}
return sWidgetPaintsBackground;
return StaticPrefs::android_widget_paints_background();
}
bool nsWindow::NeedsPaint() {