зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1738614 - Remove TextForeground/Background system colors. r=mstange
Same thing, there's nor reason these should be different from other CSS-exposed colors. Differential Revision: https://phabricator.services.mozilla.com/D129991
This commit is contained in:
Родитель
ac14d7e42d
Коммит
923cf5df84
|
@ -227,10 +227,6 @@ pub enum SystemColor {
|
|||
Widget3DHighlight,
|
||||
#[css(skip)]
|
||||
Widget3DShadow,
|
||||
#[css(skip)]
|
||||
TextBackground,
|
||||
#[css(skip)]
|
||||
TextForeground,
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
TextSelectBackgroundDisabled,
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
|
|
|
@ -141,10 +141,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme,
|
|||
case ColorID::Widget3DShadow:
|
||||
aColor = NS_RGB(0x40, 0x40, 0x40);
|
||||
break;
|
||||
case ColorID::TextForeground:
|
||||
// not used?
|
||||
aColor = mSystemColors.textColorPrimary;
|
||||
break;
|
||||
|
||||
case ColorID::ThemedScrollbarThumbInactive:
|
||||
case ColorID::ThemedScrollbarThumb:
|
||||
|
@ -188,7 +184,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme,
|
|||
case ColorID::Inactiveborder: // inactive window border
|
||||
case ColorID::Inactivecaption: // inactive window caption
|
||||
case ColorID::Scrollbar: // scrollbar gray area
|
||||
case ColorID::TextBackground: // not used?
|
||||
case ColorID::WidgetBackground:
|
||||
aColor = mSystemColors.colorBackground;
|
||||
break;
|
||||
|
|
|
@ -199,7 +199,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor
|
|||
color = nsCocoaFeatures::OnMontereyOrLater() ? GetColorFromNSColor(NSColor.controlTextColor)
|
||||
: NS_RGB(0xFF, 0xFF, 0xFF);
|
||||
break;
|
||||
case ColorID::TextForeground:
|
||||
case ColorID::Captiontext:
|
||||
case ColorID::Menutext:
|
||||
case ColorID::Infotext:
|
||||
|
|
|
@ -403,7 +403,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID,
|
|||
// These colors don't seem to be used for anything anymore in Mozilla
|
||||
// The CSS2 colors below are used.
|
||||
case ColorID::WidgetBackground:
|
||||
case ColorID::TextBackground:
|
||||
case ColorID::Appworkspace: // MDI background color
|
||||
case ColorID::Background: // desktop background
|
||||
case ColorID::Window:
|
||||
|
@ -413,7 +412,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID,
|
|||
aColor = mMozWindowBackground;
|
||||
break;
|
||||
case ColorID::WidgetForeground:
|
||||
case ColorID::TextForeground:
|
||||
case ColorID::Windowtext:
|
||||
case ColorID::MozDialogtext:
|
||||
aColor = mMozWindowText;
|
||||
|
|
|
@ -64,12 +64,6 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme,
|
|||
case ColorID::SpellCheckerUnderline:
|
||||
aColor = NS_RGB(0xff, 0x00, 0x00);
|
||||
break;
|
||||
case ColorID::TextBackground:
|
||||
aColor = NS_RGB(0xff, 0xff, 0xff);
|
||||
break;
|
||||
case ColorID::TextForeground:
|
||||
aColor = NS_RGB(0x00, 0x00, 0x00);
|
||||
break;
|
||||
case ColorID::TextHighlightBackground:
|
||||
aColor = NS_RGB(0xef, 0x0f, 0xff);
|
||||
break;
|
||||
|
|
|
@ -534,7 +534,7 @@ std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeRangeProgressColors(
|
|||
std::pair<sRGBColor, sRGBColor> nsNativeBasicTheme::ComputeRangeTrackColors(
|
||||
const EventStates& aState, const Colors& aColors) {
|
||||
if (aColors.HighContrast()) {
|
||||
return aColors.SystemPair(StyleSystemColor::TextBackground,
|
||||
return aColors.SystemPair(StyleSystemColor::Window,
|
||||
StyleSystemColor::Buttontext);
|
||||
}
|
||||
bool isActive =
|
||||
|
@ -622,7 +622,7 @@ std::array<sRGBColor, 3> nsNativeBasicTheme::ComputeFocusRectColors(
|
|||
if (aColors.HighContrast()) {
|
||||
return {aColors.System(StyleSystemColor::Selecteditem),
|
||||
aColors.System(StyleSystemColor::Buttontext),
|
||||
aColors.System(StyleSystemColor::TextBackground)};
|
||||
aColors.System(StyleSystemColor::Window)};
|
||||
}
|
||||
const auto& accent = aColors.Accent();
|
||||
const sRGBColor middle =
|
||||
|
@ -642,7 +642,7 @@ sRGBColor nsNativeBasicTheme::ComputeScrollbarTrackColor(
|
|||
const EventStates& aDocumentState, const Colors& aColors) {
|
||||
const nsStyleUI* ui = aStyle.StyleUI();
|
||||
if (aColors.HighContrast()) {
|
||||
return aColors.System(StyleSystemColor::TextBackground);
|
||||
return aColors.System(StyleSystemColor::Window);
|
||||
}
|
||||
if (ShouldUseDarkScrollbar(aFrame, aStyle)) {
|
||||
return sRGBColor::FromU8(20, 20, 25, 77);
|
||||
|
@ -825,7 +825,7 @@ sRGBColor nsNativeBasicTheme::ComputeScrollbarThumbColor(
|
|||
return StyleSystemColor::ThemedScrollbarThumbHover;
|
||||
}
|
||||
if (aColors.HighContrast()) {
|
||||
return StyleSystemColor::TextForeground;
|
||||
return StyleSystemColor::Windowtext;
|
||||
}
|
||||
return StyleSystemColor::ThemedScrollbarThumb;
|
||||
}();
|
||||
|
@ -847,8 +847,8 @@ nsNativeBasicTheme::ComputeScrollbarButtonColors(
|
|||
return aColors.SystemPair(StyleSystemColor::Selecteditem,
|
||||
StyleSystemColor::Buttonface);
|
||||
}
|
||||
return aColors.SystemPair(StyleSystemColor::TextBackground,
|
||||
StyleSystemColor::TextForeground);
|
||||
return aColors.SystemPair(StyleSystemColor::Window,
|
||||
StyleSystemColor::Windowtext);
|
||||
}
|
||||
|
||||
auto trackColor =
|
||||
|
|
|
@ -205,8 +205,6 @@ static const char sColorPrefs[][41] = {
|
|||
"ui.widgetSelectForeground",
|
||||
"ui.widget3DHighlight",
|
||||
"ui.widget3DShadow",
|
||||
"ui.textBackground",
|
||||
"ui.textForeground",
|
||||
"ui.textSelectBackgroundDisabled",
|
||||
"ui.textSelectBackgroundAttention",
|
||||
"ui.textHighlightBackground",
|
||||
|
@ -633,7 +631,6 @@ Maybe<nscolor> nsXPLookAndFeel::GenericDarkColor(ColorID aID) {
|
|||
case ColorID::Window: // --in-content-page-background
|
||||
case ColorID::Background:
|
||||
case ColorID::Menu:
|
||||
case ColorID::TextBackground:
|
||||
color = kWindowBackground;
|
||||
break;
|
||||
case ColorID::MozOddtreerow:
|
||||
|
@ -642,7 +639,6 @@ Maybe<nscolor> nsXPLookAndFeel::GenericDarkColor(ColorID aID) {
|
|||
break;
|
||||
case ColorID::Windowtext: // --in-content-page-color
|
||||
case ColorID::Menutext:
|
||||
case ColorID::TextForeground:
|
||||
case ColorID::MozDialogtext:
|
||||
case ColorID::Fieldtext:
|
||||
case ColorID::Buttontext: // --in-content-button-text-color (via
|
||||
|
@ -1196,8 +1192,6 @@ static bool ColorIsCSSAccessible(LookAndFeel::ColorID aId) {
|
|||
case ColorID::WidgetSelectForeground:
|
||||
case ColorID::Widget3DHighlight:
|
||||
case ColorID::Widget3DShadow:
|
||||
case ColorID::TextBackground:
|
||||
case ColorID::TextForeground:
|
||||
case ColorID::TextSelectBackgroundDisabled:
|
||||
case ColorID::TextSelectBackgroundAttention:
|
||||
case ColorID::TextHighlightBackground:
|
||||
|
|
|
@ -64,12 +64,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) {
|
|||
case ColorID::Widget3DShadow:
|
||||
aResult = NS_RGB(0x40, 0x40, 0x40);
|
||||
break;
|
||||
case ColorID::TextBackground:
|
||||
aResult = NS_RGB(0xff, 0xff, 0xff);
|
||||
break;
|
||||
case ColorID::TextForeground:
|
||||
aResult = NS_RGB(0x00, 0x00, 0x00);
|
||||
break;
|
||||
case ColorID::Highlight:
|
||||
aResult = NS_RGB(0xaa, 0xaa, 0xaa);
|
||||
break;
|
||||
|
|
|
@ -145,12 +145,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme,
|
|||
case ColorID::Widget3DShadow:
|
||||
idx = COLOR_BTNSHADOW;
|
||||
break;
|
||||
case ColorID::TextBackground:
|
||||
idx = COLOR_WINDOW;
|
||||
break;
|
||||
case ColorID::TextForeground:
|
||||
idx = COLOR_WINDOWTEXT;
|
||||
break;
|
||||
case ColorID::IMERawInputBackground:
|
||||
case ColorID::IMEConvertedTextBackground:
|
||||
aColor = NS_TRANSPARENT;
|
||||
|
|
Загрузка…
Ссылка в новой задаче