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
Родитель c99009c207
Коммит 533fc20279
3 изменённых файлов: 17 добавлений и 11 удалений

Просмотреть файл

@ -178,6 +178,19 @@
value: false value: false
mirror: always 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." # Prefs starting with "apz."
# The apz prefs are explained in AsyncPanZoomController.cpp # The apz prefs are explained in AsyncPanZoomController.cpp

Просмотреть файл

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

Просмотреть файл

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