diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 130cde1670d8..921ebbd299cd 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -217,8 +217,8 @@ void nsListControlFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt) { // set up back stop colors and then ask L&F service for the real colors nscolor color = LookAndFeel::Color( - lastItemIsSelected ? LookAndFeel::ColorID::WidgetSelectForeground - : LookAndFeel::ColorID::WidgetSelectBackground, + lastItemIsSelected ? LookAndFeel::ColorID::Selecteditem + : LookAndFeel::ColorID::Selecteditemtext, this); nsCSSRendering::PaintFocus(presContext, aDrawTarget, fRect, color); diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index ee6ed3409274..04e0ca453880 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -1364,16 +1364,16 @@ void nsHTMLFramesetBorderFrame::PaintBorder(DrawTarget* aDrawTarget, if (widthInPixels <= 0) return; ColorPattern bgColor(ToDeviceColor(LookAndFeel::Color( - LookAndFeel::ColorID::WidgetBackground, this, NS_RGB(200, 200, 200)))); + LookAndFeel::ColorID::Window, this, NS_RGB(200, 200, 200)))); ColorPattern fgColor(ToDeviceColor(LookAndFeel::Color( - LookAndFeel::ColorID::WidgetForeground, this, NS_RGB(0, 0, 0)))); + LookAndFeel::ColorID::Windowtext, this, NS_RGB(0, 0, 0)))); ColorPattern hltColor(ToDeviceColor(LookAndFeel::Color( - LookAndFeel::ColorID::Widget3DHighlight, this, NS_RGB(255, 255, 255)))); + LookAndFeel::ColorID::Threedhighlight, this, NS_RGB(255, 255, 255)))); ColorPattern sdwColor(ToDeviceColor(LookAndFeel::Color( - LookAndFeel::ColorID::Widget3DShadow, this, NS_RGB(128, 128, 128)))); + LookAndFeel::ColorID::Threedshadow, this, NS_RGB(128, 128, 128)))); ColorPattern color(ToDeviceColor(NS_RGB(255, 255, 255))); // default to white if (mVisibility) { diff --git a/servo/components/style/values/specified/color.rs b/servo/components/style/values/specified/color.rs index e75fc6a68c78..e649b54bc068 100644 --- a/servo/components/style/values/specified/color.rs +++ b/servo/components/style/values/specified/color.rs @@ -215,18 +215,6 @@ pub enum Color { #[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)] #[repr(u8)] pub enum SystemColor { - #[css(skip)] - WidgetBackground, - #[css(skip)] - WidgetForeground, - #[css(skip)] - WidgetSelectBackground, - #[css(skip)] - WidgetSelectForeground, - #[css(skip)] - Widget3DHighlight, - #[css(skip)] - Widget3DShadow, #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] TextSelectBackgroundDisabled, #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] diff --git a/toolkit/components/browser/nsWebBrowser.cpp b/toolkit/components/browser/nsWebBrowser.cpp index 83f86cbd6097..d92c1a933de8 100644 --- a/toolkit/components/browser/nsWebBrowser.cpp +++ b/toolkit/components/browser/nsWebBrowser.cpp @@ -131,9 +131,9 @@ already_AddRefed nsWebBrowser::Create( // get the system default window background colour // // TODO(emilio): Can we get the color-scheme from somewhere here? - browser->mBackgroundColor = LookAndFeel::Color( - LookAndFeel::ColorID::WindowBackground, LookAndFeel::ColorScheme::Light, - LookAndFeel::UseStandins::No); + browser->mBackgroundColor = + LookAndFeel::Color(LookAndFeel::ColorID::Window, ColorScheme::Light, + LookAndFeel::UseStandins::No); // HACK ALERT - this registration registers the nsDocShellTreeOwner as a // nsIWebBrowserListener so it can setup its MouseListener in one of the diff --git a/widget/WidgetMessageUtils.h b/widget/WidgetMessageUtils.h index c024d7a5cf41..091e6dabcd16 100644 --- a/widget/WidgetMessageUtils.h +++ b/widget/WidgetMessageUtils.h @@ -32,12 +32,14 @@ struct ParamTraits template <> struct ParamTraits - : ContiguousEnumSerializer { + : ContiguousEnumSerializer< + mozilla::LookAndFeel::ColorID, + mozilla::LookAndFeel::ColorID::TextSelectBackgroundDisabled, + mozilla::LookAndFeel::ColorID::End> { using IdType = std::underlying_type_t; static_assert( - static_cast(mozilla::LookAndFeel::ColorID::WidgetBackground) == + static_cast( + mozilla::LookAndFeel::ColorID::TextSelectBackgroundDisabled) == IdType(0)); }; diff --git a/widget/android/nsLookAndFeel.cpp b/widget/android/nsLookAndFeel.cpp index 8eb2d97564ec..d5a67ce18f96 100644 --- a/widget/android/nsLookAndFeel.cpp +++ b/widget/android/nsLookAndFeel.cpp @@ -131,16 +131,9 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme, switch (aID) { // These colors don't seem to be used for anything anymore in Mozilla // The CSS2 colors below are used. - case ColorID::WidgetForeground: case ColorID::MozMenubartext: aColor = mSystemColors.colorForeground; break; - case ColorID::Widget3DHighlight: - aColor = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case ColorID::Widget3DShadow: - aColor = NS_RGB(0x40, 0x40, 0x40); - break; case ColorID::ThemedScrollbarThumbInactive: case ColorID::ThemedScrollbarThumb: @@ -151,7 +144,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aColorScheme, case ColorID::IMESelectedRawTextBackground: case ColorID::IMESelectedConvertedTextBackground: - case ColorID::WidgetSelectBackground: aColor = mSystemColors.textColorHighlight; break; case ColorID::IMESelectedRawTextForeground: @@ -184,7 +176,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::WidgetBackground: aColor = mSystemColors.colorBackground; break; case ColorID::Graytext: // disabled text in windows, menus, etc. diff --git a/widget/cocoa/nsLookAndFeel.mm b/widget/cocoa/nsLookAndFeel.mm index 90e2a5dd7361..26d1ad0e002b 100644 --- a/widget/cocoa/nsLookAndFeel.mm +++ b/widget/cocoa/nsLookAndFeel.mm @@ -118,18 +118,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor case ColorID::Infobackground: color = NS_RGB(0xdd, 0xdd, 0xdd); break; - case ColorID::WidgetSelectBackground: - color = NS_RGB(0x80, 0x80, 0x80); - break; - case ColorID::WidgetSelectForeground: - color = NS_RGB(0x00, 0x00, 0x80); - break; - case ColorID::Widget3DHighlight: - color = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case ColorID::Widget3DShadow: - color = NS_RGB(0x40, 0x40, 0x40); - break; case ColorID::Highlight: color = ProcessSelectionBackground(GetColorFromNSColor(NSColor.selectedTextBackgroundColor), aScheme); @@ -206,7 +194,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor color = GetColorFromNSColor(NSColor.textColor); break; case ColorID::Windowtext: - case ColorID::WidgetForeground: color = GetColorFromNSColor(NSColor.windowFrameTextColor); break; case ColorID::Activecaption: @@ -268,7 +255,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, nscolor case ColorID::Windowframe: color = GetColorFromNSColor(NSColor.windowFrameColor); break; - case ColorID::WidgetBackground: case ColorID::Window: { if (@available(macOS 10.14, *)) { color = GetColorFromNSColor(NSColor.windowBackgroundColor); diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp index 4e11d325218c..5abce4edd32f 100644 --- a/widget/gtk/nsLookAndFeel.cpp +++ b/widget/gtk/nsLookAndFeel.cpp @@ -402,7 +402,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID, switch (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::Appworkspace: // MDI background color case ColorID::Background: // desktop background case ColorID::Window: @@ -411,12 +410,10 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID, case ColorID::MozCombobox: aColor = mMozWindowBackground; break; - case ColorID::WidgetForeground: case ColorID::Windowtext: case ColorID::MozDialogtext: aColor = mMozWindowText; break; - case ColorID::WidgetSelectBackground: case ColorID::IMESelectedRawTextBackground: case ColorID::IMESelectedConvertedTextBackground: case ColorID::MozDragtargetzone: @@ -429,7 +426,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID, break; } [[fallthrough]]; - case ColorID::WidgetSelectForeground: case ColorID::IMESelectedRawTextForeground: case ColorID::IMESelectedConvertedTextForeground: aColor = mTextSelectedText; @@ -448,12 +444,6 @@ nsresult nsLookAndFeel::PerThemeData::GetColor(ColorID aID, case ColorID::MozCellhighlighttext: aColor = mMozCellHighlightText; break; - case ColorID::Widget3DHighlight: - aColor = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case ColorID::Widget3DShadow: - aColor = NS_RGB(0x40, 0x40, 0x40); - break; case ColorID::IMERawInputBackground: case ColorID::IMEConvertedTextBackground: aColor = NS_TRANSPARENT; diff --git a/widget/headless/HeadlessLookAndFeelGTK.cpp b/widget/headless/HeadlessLookAndFeelGTK.cpp index 6f69bafbe5f9..52cf4f9b96c0 100644 --- a/widget/headless/HeadlessLookAndFeelGTK.cpp +++ b/widget/headless/HeadlessLookAndFeelGTK.cpp @@ -76,24 +76,6 @@ nsresult HeadlessLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, case ColorID::TextSelectBackgroundDisabled: aColor = NS_RGB(0xaa, 0xaa, 0xaa); break; - case ColorID::Widget3DHighlight: - aColor = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case ColorID::Widget3DShadow: - aColor = NS_RGB(0x40, 0x40, 0x40); - break; - case ColorID::WidgetBackground: - aColor = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case ColorID::WidgetForeground: - aColor = NS_RGB(0x00, 0x00, 0x00); - break; - case ColorID::WidgetSelectBackground: - aColor = NS_RGB(0x80, 0x80, 0x80); - break; - case ColorID::WidgetSelectForeground: - aColor = NS_RGB(0x00, 0x00, 0x80); - break; case ColorID::Highlight: case ColorID::Selecteditem: case ColorID::MozAccentColor: diff --git a/widget/nsXPLookAndFeel.cpp b/widget/nsXPLookAndFeel.cpp index 692019bfadd6..2d469e29ddf7 100644 --- a/widget/nsXPLookAndFeel.cpp +++ b/widget/nsXPLookAndFeel.cpp @@ -199,12 +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 // specified/color.rs static const char sColorPrefs[][41] = { - "ui.widgetBackground", - "ui.widgetForeground", - "ui.widgetSelectBackground", - "ui.widgetSelectForeground", - "ui.widget3DHighlight", - "ui.widget3DShadow", "ui.textSelectBackgroundDisabled", "ui.textSelectBackgroundAttention", "ui.textHighlightBackground", @@ -1186,12 +1180,6 @@ static bool ColorIsCSSAccessible(LookAndFeel::ColorID aId) { using ColorID = LookAndFeel::ColorID; switch (aId) { - case ColorID::WidgetBackground: - case ColorID::WidgetForeground: - case ColorID::WidgetSelectBackground: - case ColorID::WidgetSelectForeground: - case ColorID::Widget3DHighlight: - case ColorID::Widget3DShadow: case ColorID::TextSelectBackgroundDisabled: case ColorID::TextSelectBackgroundAttention: case ColorID::TextHighlightBackground: diff --git a/widget/uikit/nsLookAndFeel.mm b/widget/uikit/nsLookAndFeel.mm index 950228342042..00320d80f6b3 100644 --- a/widget/uikit/nsLookAndFeel.mm +++ b/widget/uikit/nsLookAndFeel.mm @@ -46,24 +46,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID, ColorScheme, nscolor& aResult) { nsresult res = NS_OK; switch (aID) { - case ColorID::WidgetBackground: - aResult = NS_RGB(0xdd, 0xdd, 0xdd); - break; - case ColorID::WidgetForeground: - aResult = NS_RGB(0x00, 0x00, 0x00); - break; - case ColorID::WidgetSelectBackground: - aResult = NS_RGB(0x80, 0x80, 0x80); - break; - case ColorID::WidgetSelectForeground: - aResult = NS_RGB(0x00, 0x00, 0x80); - break; - case ColorID::Widget3DHighlight: - aResult = NS_RGB(0xa0, 0xa0, 0xa0); - break; - case ColorID::Widget3DShadow: - aResult = NS_RGB(0x40, 0x40, 0x40); - break; case ColorID::Highlight: aResult = NS_RGB(0xaa, 0xaa, 0xaa); break; diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp index deed87127807..82566f1b0304 100644 --- a/widget/windows/nsLookAndFeel.cpp +++ b/widget/windows/nsLookAndFeel.cpp @@ -127,24 +127,6 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, ColorScheme aScheme, int idx; switch (aID) { - case ColorID::WidgetBackground: - idx = COLOR_BTNFACE; - break; - case ColorID::WidgetForeground: - idx = COLOR_BTNTEXT; - break; - case ColorID::WidgetSelectBackground: - idx = COLOR_HIGHLIGHT; - break; - case ColorID::WidgetSelectForeground: - idx = COLOR_HIGHLIGHTTEXT; - break; - case ColorID::Widget3DHighlight: - idx = COLOR_BTNHIGHLIGHT; - break; - case ColorID::Widget3DShadow: - idx = COLOR_BTNSHADOW; - break; case ColorID::IMERawInputBackground: case ColorID::IMEConvertedTextBackground: aColor = NS_TRANSPARENT;