Bug 1694059 - Rename various nnt prefs. r=spohl,mstange

As per feedback in D105931.

Differential Revision: https://phabricator.services.mozilla.com/D105991
This commit is contained in:
Emilio Cobos Álvarez 2021-02-22 20:05:35 +00:00
Родитель 1a0e71c351
Коммит 15ff419df0
16 изменённых файлов: 33 добавлений и 33 удалений

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

@ -295,9 +295,7 @@ const kBoldFontWeight = function equalsToBold(aWeight) {
return aWeight > 400;
};
let isNNT = SpecialPowers.getBoolPref(
"widget.disable-native-theme-for-content"
);
let isNNT = SpecialPowers.getBoolPref("widget.non-native-theme.enabled");
// The pt font size of the input element can vary by Linux distro.
const kInputFontSize =
WIN || (MAC && isNNT)

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

@ -16897,7 +16897,7 @@ void Document::AddPendingFrameStaticClone(nsFrameLoaderOwner* aElement,
}
bool Document::ShouldAvoidNativeTheme() const {
return StaticPrefs::widget_disable_native_theme_for_content() &&
return StaticPrefs::widget_non_native_theme_enabled() &&
(!IsInChromeDocShell() || XRE_IsContentProcess());
}

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

@ -34,7 +34,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=869314
let Ci = SpecialPowers.Ci;
let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
let osName = sysInfo.getProperty("name");
let isNNT = SpecialPowers.getBoolPref("widget.disable-native-theme-for-content");
let isNNT = SpecialPowers.getBoolPref("widget.non-native-theme.enabled");
if (osName == "Darwin" && !isNNT) { // Native styled macOS form controls.
// This test is for macOS with native styled form controls only. See bug for more info.
ok(document.getElementById("selectbox1").clientWidth >

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

@ -19,7 +19,7 @@
body > button:nth-child(15) { margin: 0px; padding: 2px 4px 6px 8px; }
body > button:nth-child(16) { margin: 2px 4px 6px 8px; padding: 0px; }
@supports -moz-bool-pref("widget.disable-native-theme-for-content") {
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
/* The non-native theme has different widget-supplied padding values
* for <input type="color"> and <button>, and so we must calculate
* the color swatch height explicitly. These are computed as the

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

@ -15,7 +15,7 @@ button.input-color {
height: 23px;
}
@supports -moz-bool-pref("widget.disable-native-theme-for-content") {
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
/* The non-native theme has different widget-supplied padding values
* for <input type="color"> and <button> -- `4px 4px 4px 4px` for the
* former, and `1px 4px 1px 4px` for the latter. So we size the

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

@ -18,7 +18,7 @@
padding: 8px 1px;
}
@supports -moz-bool-pref("widget.disable-native-theme-for-content") {
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
.ltr button,
.rtl button,
.ltr input[type="button"],

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

@ -19,7 +19,7 @@
padding: 8px 1px;
}
@supports -moz-bool-pref("widget.disable-native-theme-for-content") {
@supports -moz-bool-pref("widget.non-native-theme.enabled") {
:is(.ltr, .rtl, .v-rl) input[type="color"] {
padding: 4px;
}

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

@ -584,7 +584,7 @@ function BuildConditionSandbox(aURL) {
sandbox.windowsDefaultTheme = g.containingWindow.matchMedia("(-moz-windows-default-theme)").matches;
try {
sandbox.nativeThemePref = !prefs.getBoolPref("widget.disable-native-theme-for-content");
sandbox.nativeThemePref = !prefs.getBoolPref("widget.non-native-theme.enabled");
} catch (e) {
sandbox.nativeThemePref = true;
}

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

@ -9695,7 +9695,7 @@
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
# Run content processes in headless mode and disallow connections to
# the X server. Experimental; breaks WebGL and Flash, and requires
# `widget.disable-native-theme-for-content` and `widget.remote-look-and-feel`.
# `widget.non-native-theme.enabled` and `widget.remote-look-and-feel`.
# Changing it requires a restart because sandbox policy information dependent
# on it is cached. See bug 1640345 for details.
- name: security.sandbox.content.headless
@ -10482,7 +10482,7 @@
#
# NOTE(emilio): When changing this make sure to update the non_native_theme
# entry in python/mozbuild/mozbuild/mozinfo.py
- name: widget.disable-native-theme-for-content
- name: widget.non-native-theme.enabled
type: RelaxedAtomicBool
#if defined(XP_LINUX) && defined(NIGHTLY_BUILD) && !defined(ANDROID)
value: true
@ -10494,38 +10494,38 @@
mirror: always
# The size in CSS pixels at full zoom of the minimum scrollbar width.
- name: widget.gtk.non-native.scrollbar.normal-size
- name: widget.non-native-theme.gtk.scrollbar.normal-size
type: uint32_t
value: 12
mirror: always
# The size in CSS pixels at full zoom of the "thin" scrollbars.
- name: widget.gtk.non-native.scrollbar.thin-size
- name: widget.non-native-theme.gtk.scrollbar.thin-size
type: uint32_t
value: 6
mirror: always
# The amount of space that the thumb should fill the scrollbar, from zero to
# one.
- name: widget.gtk.non-native.scrollbar.thumb-size
- name: widget.non-native-theme.gtk.scrollbar.thumb-size
type: float
value: 0.75
mirror: always
# The minimum size of the scroll thumb, in the scrollbar direction.
- name: widget.gtk.non-native.scrollbar.thumb-cross-size
- name: widget.non-native-theme.gtk.scrollbar.thumb-cross-size
type: uint32_t
value: 40
mirror: always
# Whether the thumb should be rounded for the non-native scrollbars.
- name: widget.gtk.non-native.round-thumb
- name: widget.non-native-theme.gtk.scrollbar.round-thumb
type: bool
value: true
mirror: always
# Whether buttons shouldn't be suppressed for non-native scrollbars.
- name: widget.gtk.non-native.scrollbar.allow-buttons
- name: widget.non-native-theme.gtk.scrollbar.allow-buttons
type: bool
value: false
mirror: always
@ -10534,7 +10534,7 @@
#
# TODO(emilio): This should probably do the right thing in most other
# platforms, but stick to the standard colors on those.
- name: widget.non-native.use-theme-accent
- name: widget.non-native-theme.use-theme-accent
type: bool
#ifdef MOZ_WIDGET_GTK
value: true

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

@ -55,7 +55,7 @@ support-files =
rtlchrome/rtl.manifest
prefs =
gfx.font_rendering.fallback.async=false
widget.disable-native-theme-for-content=false
widget.non-native-theme.enabled=false
[test_about_networking.html]
[test_arrowpanel.xhtml]

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

@ -1,5 +1,5 @@
# This folder is registered in the chrome manifest at layout/tools/reftest/jar.mn.
defaults pref(widget.disable-native-theme-for-content,false) # These are tests for the native theme.
defaults pref(widget.non-native-theme.enabled,false) # These are tests for the native theme.
skip-if(!cocoaWidget) == chrome://reftest/content/osx-theme/radiosize.xhtml chrome://reftest/content/osx-theme/radiosize-ref.xhtml
skip-if(!cocoaWidget) == chrome://reftest/content/osx-theme/checkboxsize.xhtml chrome://reftest/content/osx-theme/checkboxsize-ref.xhtml

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

@ -28,7 +28,7 @@ RemoteLookAndFeel::RemoteLookAndFeel(FullLookAndFeel&& aData)
"Only content processes should be using a RemoteLookAndFeel");
#ifdef MOZ_WIDGET_GTK
if (!StaticPrefs::widget_disable_native_theme_for_content()) {
if (!StaticPrefs::widget_non_native_theme_enabled()) {
// Configure the theme in this content process with the Gtk theme that was
// chosen by WithThemeConfiguredForContent in the parent process.
nsLookAndFeel::ConfigureTheme(aData.theme());
@ -45,7 +45,7 @@ void RemoteLookAndFeel::SetDataImpl(FullLookAndFeel&& aData) {
mTables = std::move(aData.tables());
#ifdef MOZ_WIDGET_GTK
if (!StaticPrefs::widget_disable_native_theme_for_content()) {
if (!StaticPrefs::widget_non_native_theme_enabled()) {
// Configure the theme in this content process with the Gtk theme that was
// chosen by WithThemeConfiguredForContent in the parent process.
nsLookAndFeel::ConfigureTheme(aData.theme());

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

@ -49,7 +49,7 @@ nsITheme::Transparency nsNativeBasicThemeGTK::GetWidgetTransparency(
}
bool nsNativeBasicThemeGTK::ThemeSupportsScrollbarButtons() {
return StaticPrefs::widget_gtk_non_native_scrollbar_allow_buttons();
return StaticPrefs::widget_non_native_theme_gtk_scrollbar_allow_buttons();
}
auto nsNativeBasicThemeGTK::GetScrollbarSizes(nsPresContext* aPresContext,
@ -58,8 +58,8 @@ auto nsNativeBasicThemeGTK::GetScrollbarSizes(nsPresContext* aPresContext,
DPIRatio dpiRatio = GetDPIRatioForScrollbarPart(aPresContext);
CSSCoord size =
aWidth == StyleScrollbarWidth::Thin
? StaticPrefs::widget_gtk_non_native_scrollbar_thin_size()
: StaticPrefs::widget_gtk_non_native_scrollbar_normal_size();
? StaticPrefs::widget_non_native_theme_gtk_scrollbar_thin_size()
: StaticPrefs::widget_non_native_theme_gtk_scrollbar_normal_size();
LayoutDeviceIntCoord s = (size * dpiRatio).Truncated();
return {s, s};
}
@ -109,7 +109,7 @@ nsNativeBasicThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
aAppearance == StyleAppearance::ScrollbarthumbHorizontal ||
aAppearance == StyleAppearance::ScrollbarthumbVertical) {
CSSCoord thumbSize(
StaticPrefs::widget_gtk_non_native_scrollbar_thumb_cross_size());
StaticPrefs::widget_non_native_theme_gtk_scrollbar_thumb_cross_size());
const bool isVertical =
aAppearance == StyleAppearance::ScrollbarVertical ||
aAppearance == StyleAppearance::ScrollbarthumbVertical;
@ -136,12 +136,13 @@ void nsNativeBasicThemeGTK::PaintScrollbarThumb(
{
float factor = std::max(
0.0f, 1.0f - StaticPrefs::widget_gtk_non_native_scrollbar_thumb_size());
0.0f,
1.0f - StaticPrefs::widget_non_native_theme_gtk_scrollbar_thumb_size());
thumbRect.Deflate((aHorizontal ? aRect.height : aRect.width) * factor);
}
LayoutDeviceCoord radius =
StaticPrefs::widget_gtk_non_native_round_thumb()
StaticPrefs::widget_non_native_theme_gtk_scrollbar_round_thumb()
? (aHorizontal ? thumbRect.height : thumbRect.width) / 2.0f
: 0.0f;

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

@ -68,7 +68,7 @@ static LayoutDeviceIntCoord SnapBorderWidth(
}
static nscolor ThemedAccentColor(bool aBackground) {
MOZ_ASSERT(StaticPrefs::widget_non_native_use_theme_accent());
MOZ_ASSERT(StaticPrefs::widget_non_native_theme_use_theme_accent());
nscolor color = LookAndFeel::GetColor(
aBackground ? LookAndFeel::ColorID::MozAccentColor
: LookAndFeel::ColorID::MozAccentColorForeground);
@ -103,7 +103,7 @@ void nsNativeBasicTheme::LookAndFeelChanged() { RecomputeAccentColors(); }
void nsNativeBasicTheme::RecomputeAccentColors() {
MOZ_RELEASE_ASSERT(NS_IsMainThread());
if (!StaticPrefs::widget_non_native_use_theme_accent()) {
if (!StaticPrefs::widget_non_native_theme_use_theme_accent()) {
sAccentColorForeground = sColorWhite;
sAccentColor =
sRGBColor::UnusualFromARGB(0xff0060df); // Luminance: 13.69346%

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

@ -6,4 +6,4 @@ load 664925.xhtml
pref(apz.allow_zooming,true) pref(ui.useOverlayScrollbars,0) skip-if(!cocoaWidget) != scaled-scrollbar.html about:blank
# Test that scrollbar buttons are inhibited on Linux using the non-native theme.
skip-if(!gtkWidget) pref(widget.disable-native-theme-for-content,true) test-pref(ui.scrollArrowStyle,4097) ref-pref(ui.scrollArrowStyle,0) == scrollbar-buttons.html scrollbar-buttons.html
skip-if(!gtkWidget) pref(widget.non-native-theme.enabled,true) test-pref(ui.scrollArrowStyle,4097) ref-pref(ui.scrollArrowStyle,0) == scrollbar-buttons.html scrollbar-buttons.html

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

@ -101,7 +101,8 @@ if (outerRect.width == outer.clientWidth &&
let canvas = snapshotRect(window, outerRect);
let stats = countPixels(canvas);
let isNNT = SpecialPowers.getBoolPref("widget.disable-native-theme-for-content");
let isNNT = SpecialPowers.getBoolPref("widget.non-native-theme.enabled");
let references;
if (navigator.platform.startsWith("Win")) {
references = isNNT ? WIN_NNT_REFERENCES : WIN_REFERENCES;