From 21a3f0049fcdebeb0f7427f73ecf4f4387b2abb6 Mon Sep 17 00:00:00 2001 From: Emilio Cobos Alvarez Date: Fri, 1 Oct 2021 19:42:16 +0000 Subject: [PATCH] Bug 1733565 - Clean up button active system colors. r=mstange,desktop-theme-reviewers,dao This patch does three things: * Unifies mac and gtk's buttonactivetext system colors (unships mac's from content, but it was never meant to be exposed). * Simplifies the forms.css rules, since 's color property value doesn't affect its rendering in any meaningful way. * Adds a buttonactiveface color, which we'll use to provide dark backgrounds for buttons in Windows dark mode (and is good practice, since generally every text system color should have a corresponding background). So as-is it shouldn't change content-exposed behavior (except we stop exposing the -moz-mac-buttonactivetext to content), but it's a worthy cleanup. Depends on D127246 Differential Revision: https://phabricator.services.mozilla.com/D127259 --- browser/themes/linux/places/organizer.css | 2 +- .../shared/places/editBookmarkPanel.inc.css | 2 +- layout/style/res/forms.css | 19 +++---------------- .../test_non_content_accessible_values.html | 3 ++- .../style/values/specified/color.rs | 8 +++++--- toolkit/themes/linux/global/button.css | 2 +- toolkit/themes/linux/global/menulist.css | 2 +- toolkit/themes/osx/global/button.css | 2 +- widget/cocoa/nsLookAndFeel.mm | 3 ++- widget/gtk/nsLookAndFeel.cpp | 3 ++- widget/headless/HeadlessLookAndFeelGTK.cpp | 2 +- widget/nsXPLookAndFeel.cpp | 18 ++++++++++++++---- widget/tests/test_platform_colors.xhtml | 2 +- widget/windows/nsLookAndFeel.cpp | 2 ++ 14 files changed, 37 insertions(+), 33 deletions(-) diff --git a/browser/themes/linux/places/organizer.css b/browser/themes/linux/places/organizer.css index 421ebe9526bc..f97e9a59ece4 100644 --- a/browser/themes/linux/places/organizer.css +++ b/browser/themes/linux/places/organizer.css @@ -73,7 +73,7 @@ #placesMenu > menu:active, #placesMenu > menu[open] { - color: -moz-gtk-buttonactivetext; + color: -moz-buttonactivetext; } #placesMenu > menu::after { diff --git a/browser/themes/shared/places/editBookmarkPanel.inc.css b/browser/themes/shared/places/editBookmarkPanel.inc.css index b72ae74733ea..e61a92de53a1 100644 --- a/browser/themes/shared/places/editBookmarkPanel.inc.css +++ b/browser/themes/shared/places/editBookmarkPanel.inc.css @@ -162,7 +162,7 @@ html|img#editBookmarkPanelFavicon[src] { #editBookmarkPanel .expander-down:hover:active { /** * We override the colour here because on macOS, buttons default to - * having :hover:active buttons have color -moz-mac-buttonactivetext + * having :hover:active buttons have color -moz-buttonactivetext */ color: var(--button-color); background-color: var(--button-active-bgcolor); diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css index c0f16c72ba76..6e23a983647f 100644 --- a/layout/style/res/forms.css +++ b/layout/style/res/forms.css @@ -615,29 +615,16 @@ button, ::file-selector-button:hover, button:hover, input:is([type=reset], [type=button], [type=submit], [type=color]):hover { - background-color: -moz-buttonhoverface; -} - -::file-selector-button:hover, -button:hover, -input:is([type=reset], [type=button], [type=submit]):hover { color: -moz-buttonhovertext; + background-color: -moz-buttonhoverface; } ::file-selector-button:active:hover, button:active:hover, input:is([type=reset], [type=button], [type=submit], [type=color]):active:hover { border-style: inset; -} - -::file-selector-button:active:hover, -button:active:hover, -input:is([type=reset], [type=button], [type=submit]):active:hover { -%ifdef MOZ_WIDGET_GTK - color: -moz-gtk-buttonactivetext; -%else - color: ButtonText; -%endif + color: -moz-buttonactivetext; + background-color: -moz-buttonactiveface; } ::-moz-focus-inner { diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html index f25d5c0ffd09..b2adf8981805 100644 --- a/layout/style/test/test_non_content_accessible_values.html +++ b/layout/style/test/test_non_content_accessible_values.html @@ -6,7 +6,8 @@