зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1738614 - Remove WindowBackground/Foreground system colors. r=mstange
There's no reason for these to be different to the CSS-exposed Window/WindowText. Differential Revision: https://phabricator.services.mozilla.com/D129990
This commit is contained in:
Родитель
0aadb60b82
Коммит
ac14d7e42d
|
@ -4078,7 +4078,7 @@ void nsTextPaintStyle::InitCommonColors() {
|
||||||
"default background color is not opaque");
|
"default background color is not opaque");
|
||||||
|
|
||||||
nscolor defaultWindowBackgroundColor =
|
nscolor defaultWindowBackgroundColor =
|
||||||
LookAndFeel::Color(LookAndFeel::ColorID::WindowBackground, mFrame);
|
LookAndFeel::Color(LookAndFeel::ColorID::Window, mFrame);
|
||||||
nscolor selectionTextColor =
|
nscolor selectionTextColor =
|
||||||
LookAndFeel::Color(LookAndFeel::ColorID::Highlighttext, mFrame);
|
LookAndFeel::Color(LookAndFeel::ColorID::Highlighttext, mFrame);
|
||||||
nscolor selectionBGColor =
|
nscolor selectionBGColor =
|
||||||
|
|
|
@ -126,14 +126,10 @@ void PreferenceSheet::Prefs::LoadColors(bool aIsLight) {
|
||||||
} else {
|
} else {
|
||||||
using ColorID = LookAndFeel::ColorID;
|
using ColorID = LookAndFeel::ColorID;
|
||||||
const auto standins = LookAndFeel::UseStandins(useStandins);
|
const auto standins = LookAndFeel::UseStandins(useStandins);
|
||||||
// FIXME(emilio): Why do we look at a different set of colors when using
|
colors.mDefault = LookAndFeel::Color(ColorID::Windowtext, scheme, standins,
|
||||||
// standins vs. not?
|
colors.mDefault);
|
||||||
colors.mDefault = LookAndFeel::Color(
|
|
||||||
useStandins ? ColorID::Windowtext : ColorID::WindowForeground, scheme,
|
|
||||||
standins, colors.mDefault);
|
|
||||||
colors.mDefaultBackground = LookAndFeel::Color(
|
colors.mDefaultBackground = LookAndFeel::Color(
|
||||||
useStandins ? ColorID::Window : ColorID::WindowBackground, scheme,
|
ColorID::Window, scheme, standins, colors.mDefaultBackground);
|
||||||
standins, colors.mDefaultBackground);
|
|
||||||
colors.mLink = LookAndFeel::Color(ColorID::MozNativehyperlinktext, scheme,
|
colors.mLink = LookAndFeel::Color(ColorID::MozNativehyperlinktext, scheme,
|
||||||
standins, colors.mLink);
|
standins, colors.mLink);
|
||||||
|
|
||||||
|
|
|
@ -215,10 +215,6 @@ pub enum Color {
|
||||||
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)]
|
#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum SystemColor {
|
pub enum SystemColor {
|
||||||
#[css(skip)]
|
|
||||||
WindowBackground,
|
|
||||||
#[css(skip)]
|
|
||||||
WindowForeground,
|
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
WidgetBackground,
|
WidgetBackground,
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
|
|
|
@ -33,11 +33,11 @@ struct ParamTraits<mozilla::LookAndFeel::IntID>
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::LookAndFeel::ColorID>
|
struct ParamTraits<mozilla::LookAndFeel::ColorID>
|
||||||
: ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID,
|
: ContiguousEnumSerializer<mozilla::LookAndFeel::ColorID,
|
||||||
mozilla::LookAndFeel::ColorID::WindowBackground,
|
mozilla::LookAndFeel::ColorID::WidgetBackground,
|
||||||
mozilla::LookAndFeel::ColorID::End> {
|
mozilla::LookAndFeel::ColorID::End> {
|
||||||
using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>;
|
using IdType = std::underlying_type_t<mozilla::LookAndFeel::ColorID>;
|
||||||
static_assert(
|
static_assert(
|
||||||
static_cast<IdType>(mozilla::LookAndFeel::ColorID::WindowBackground) ==
|
static_cast<IdType>(mozilla::LookAndFeel::ColorID::WidgetBackground) ==
|
||||||
IdType(0));
|
IdType(0));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -131,9 +131,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme,
|
||||||
switch (aID) {
|
switch (aID) {
|
||||||
// These colors don't seem to be used for anything anymore in Mozilla
|
// These colors don't seem to be used for anything anymore in Mozilla
|
||||||
// The CSS2 colors below are used.
|
// The CSS2 colors below are used.
|
||||||
case ColorID::WindowForeground:
|
|
||||||
aColor = mSystemColors.textColorPrimary;
|
|
||||||
break;
|
|
||||||
case ColorID::WidgetForeground:
|
case ColorID::WidgetForeground:
|
||||||
case ColorID::MozMenubartext:
|
case ColorID::MozMenubartext:
|
||||||
aColor = mSystemColors.colorForeground;
|
aColor = mSystemColors.colorForeground;
|
||||||
|
@ -240,7 +237,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme,
|
||||||
aColor = NS_RGB(0xec, 0xe7, 0xe2);
|
aColor = NS_RGB(0xec, 0xe7, 0xe2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ColorID::WindowBackground:
|
|
||||||
case ColorID::Buttonhighlight:
|
case ColorID::Buttonhighlight:
|
||||||
case ColorID::Field:
|
case ColorID::Field:
|
||||||
case ColorID::Threedhighlight:
|
case ColorID::Threedhighlight:
|
||||||
|
|
|
@ -207,7 +207,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor
|
||||||
color = GetColorFromNSColor(NSColor.textColor);
|
color = GetColorFromNSColor(NSColor.textColor);
|
||||||
break;
|
break;
|
||||||
case ColorID::Windowtext:
|
case ColorID::Windowtext:
|
||||||
case ColorID::WindowForeground:
|
|
||||||
case ColorID::WidgetForeground:
|
case ColorID::WidgetForeground:
|
||||||
color = GetColorFromNSColor(NSColor.windowFrameTextColor);
|
color = GetColorFromNSColor(NSColor.windowFrameTextColor);
|
||||||
break;
|
break;
|
||||||
|
@ -265,13 +264,11 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor
|
||||||
color = NS_RGB(0xDA, 0xDA, 0xDA);
|
color = NS_RGB(0xDA, 0xDA, 0xDA);
|
||||||
break;
|
break;
|
||||||
case ColorID::Menu:
|
case ColorID::Menu:
|
||||||
case ColorID::TextBackground:
|
|
||||||
color = GetColorFromNSColor(NSColor.textBackgroundColor);
|
color = GetColorFromNSColor(NSColor.textBackgroundColor);
|
||||||
break;
|
break;
|
||||||
case ColorID::Windowframe:
|
case ColorID::Windowframe:
|
||||||
color = GetColorFromNSColor(NSColor.windowFrameColor);
|
color = GetColorFromNSColor(NSColor.windowFrameColor);
|
||||||
break;
|
break;
|
||||||
case ColorID::WindowBackground:
|
|
||||||
case ColorID::WidgetBackground:
|
case ColorID::WidgetBackground:
|
||||||
case ColorID::Window: {
|
case ColorID::Window: {
|
||||||
if (@available(macOS 10.14, *)) {
|
if (@available(macOS 10.14, *)) {
|
||||||
|
|
|
@ -402,7 +402,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID,
|
||||||
switch (aID) {
|
switch (aID) {
|
||||||
// These colors don't seem to be used for anything anymore in Mozilla
|
// These colors don't seem to be used for anything anymore in Mozilla
|
||||||
// The CSS2 colors below are used.
|
// The CSS2 colors below are used.
|
||||||
case ColorID::WindowBackground:
|
|
||||||
case ColorID::WidgetBackground:
|
case ColorID::WidgetBackground:
|
||||||
case ColorID::TextBackground:
|
case ColorID::TextBackground:
|
||||||
case ColorID::Appworkspace: // MDI background color
|
case ColorID::Appworkspace: // MDI background color
|
||||||
|
@ -413,7 +412,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID,
|
||||||
case ColorID::MozCombobox:
|
case ColorID::MozCombobox:
|
||||||
aColor = mMozWindowBackground;
|
aColor = mMozWindowBackground;
|
||||||
break;
|
break;
|
||||||
case ColorID::WindowForeground:
|
|
||||||
case ColorID::WidgetForeground:
|
case ColorID::WidgetForeground:
|
||||||
case ColorID::TextForeground:
|
case ColorID::TextForeground:
|
||||||
case ColorID::Windowtext:
|
case ColorID::Windowtext:
|
||||||
|
|
|
@ -100,12 +100,6 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme,
|
||||||
case ColorID::WidgetSelectForeground:
|
case ColorID::WidgetSelectForeground:
|
||||||
aColor = NS_RGB(0x00, 0x00, 0x80);
|
aColor = NS_RGB(0x00, 0x00, 0x80);
|
||||||
break;
|
break;
|
||||||
case ColorID::WindowBackground:
|
|
||||||
aColor = NS_RGB(0xff, 0xff, 0xff);
|
|
||||||
break;
|
|
||||||
case ColorID::WindowForeground:
|
|
||||||
aColor = NS_RGB(0x00, 0x00, 0x00);
|
|
||||||
break;
|
|
||||||
case ColorID::Highlight:
|
case ColorID::Highlight:
|
||||||
case ColorID::Selecteditem:
|
case ColorID::Selecteditem:
|
||||||
case ColorID::MozAccentColor:
|
case ColorID::MozAccentColor:
|
||||||
|
|
|
@ -199,8 +199,6 @@ static_assert(ArrayLength(sFloatPrefs) == size_t(LookAndFeel::FloatID::End),
|
||||||
// This array MUST be kept in the same order as the color list in
|
// This array MUST be kept in the same order as the color list in
|
||||||
// specified/color.rs
|
// specified/color.rs
|
||||||
static const char sColorPrefs[][41] = {
|
static const char sColorPrefs[][41] = {
|
||||||
"ui.windowBackground",
|
|
||||||
"ui.windowForeground",
|
|
||||||
"ui.widgetBackground",
|
"ui.widgetBackground",
|
||||||
"ui.widgetForeground",
|
"ui.widgetForeground",
|
||||||
"ui.widgetSelectBackground",
|
"ui.widgetSelectBackground",
|
||||||
|
@ -633,7 +631,6 @@ Maybe<nscolor> nsXPLookAndFeel::GenericDarkColor(ColorID aID) {
|
||||||
static constexpr nscolor kWindowText = NS_RGB(251, 251, 254);
|
static constexpr nscolor kWindowText = NS_RGB(251, 251, 254);
|
||||||
switch (aID) {
|
switch (aID) {
|
||||||
case ColorID::Window: // --in-content-page-background
|
case ColorID::Window: // --in-content-page-background
|
||||||
case ColorID::WindowBackground:
|
|
||||||
case ColorID::Background:
|
case ColorID::Background:
|
||||||
case ColorID::Menu:
|
case ColorID::Menu:
|
||||||
case ColorID::TextBackground:
|
case ColorID::TextBackground:
|
||||||
|
@ -645,7 +642,6 @@ Maybe<nscolor> nsXPLookAndFeel::GenericDarkColor(ColorID aID) {
|
||||||
break;
|
break;
|
||||||
case ColorID::Windowtext: // --in-content-page-color
|
case ColorID::Windowtext: // --in-content-page-color
|
||||||
case ColorID::Menutext:
|
case ColorID::Menutext:
|
||||||
case ColorID::WindowForeground:
|
|
||||||
case ColorID::TextForeground:
|
case ColorID::TextForeground:
|
||||||
case ColorID::MozDialogtext:
|
case ColorID::MozDialogtext:
|
||||||
case ColorID::Fieldtext:
|
case ColorID::Fieldtext:
|
||||||
|
@ -1194,8 +1190,6 @@ static bool ColorIsCSSAccessible(LookAndFeel::ColorID aId) {
|
||||||
using ColorID = LookAndFeel::ColorID;
|
using ColorID = LookAndFeel::ColorID;
|
||||||
|
|
||||||
switch (aId) {
|
switch (aId) {
|
||||||
case ColorID::WindowBackground:
|
|
||||||
case ColorID::WindowForeground:
|
|
||||||
case ColorID::WidgetBackground:
|
case ColorID::WidgetBackground:
|
||||||
case ColorID::WidgetForeground:
|
case ColorID::WidgetForeground:
|
||||||
case ColorID::WidgetSelectBackground:
|
case ColorID::WidgetSelectBackground:
|
||||||
|
|
|
@ -46,12 +46,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) {
|
||||||
nsresult res = NS_OK;
|
nsresult res = NS_OK;
|
||||||
|
|
||||||
switch (aID) {
|
switch (aID) {
|
||||||
case ColorID::WindowBackground:
|
|
||||||
aResult = NS_RGB(0xff, 0xff, 0xff);
|
|
||||||
break;
|
|
||||||
case ColorID::WindowForeground:
|
|
||||||
aResult = NS_RGB(0x00, 0x00, 0x00);
|
|
||||||
break;
|
|
||||||
case ColorID::WidgetBackground:
|
case ColorID::WidgetBackground:
|
||||||
aResult = NS_RGB(0xdd, 0xdd, 0xdd);
|
aResult = NS_RGB(0xdd, 0xdd, 0xdd);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -127,12 +127,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme,
|
||||||
|
|
||||||
int idx;
|
int idx;
|
||||||
switch (aID) {
|
switch (aID) {
|
||||||
case ColorID::WindowBackground:
|
|
||||||
idx = COLOR_WINDOW;
|
|
||||||
break;
|
|
||||||
case ColorID::WindowForeground:
|
|
||||||
idx = COLOR_WINDOWTEXT;
|
|
||||||
break;
|
|
||||||
case ColorID::WidgetBackground:
|
case ColorID::WidgetBackground:
|
||||||
idx = COLOR_BTNFACE;
|
idx = COLOR_BTNFACE;
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче