From 750c9ee814c339dd267adea3eb39492ba74bd145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 27 May 2023 16:20:01 +0200 Subject: [PATCH] style: Clean up GTK titlebar colors Apparently ActiveCaption/CaptionText/InactiveCaption/InactiveCaptionText are supposed to be used for titlebars, so implement them properly and remove the GTK-specific colors. Differential Revision: https://phabricator.services.mozilla.com/D128028 --- components/style/values/specified/color.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs index 95563d4f9ee..44d290bcb0e 100644 --- a/components/style/values/specified/color.rs +++ b/components/style/values/specified/color.rs @@ -218,7 +218,14 @@ pub enum Color { InheritFromBodyQuirk, } -/// System colors. +/// System colors. A bunch of these are ad-hoc, others come from Windows: +/// +/// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor +/// +/// Others are HTML/CSS specific. Spec is: +/// +/// https://drafts.csswg.org/css-color/#css-system-colors +/// https://drafts.csswg.org/css-color/#deprecated-system-colors #[allow(missing_docs)] #[cfg(feature = "gecko")] #[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, ToCss, ToShmem)] @@ -291,6 +298,7 @@ pub enum SystemColor { #[css(skip)] ThemedScrollbarThumbInactive, Activeborder, + /// Background in the (active) titlebar. Activecaption, Appworkspace, Background, @@ -298,6 +306,7 @@ pub enum SystemColor { Buttonhighlight, Buttonshadow, Buttontext, + /// Text color in the (active) titlebar. Captiontext, #[parse(aliases = "-moz-field")] Field, @@ -311,7 +320,9 @@ pub enum SystemColor { Highlight, Highlighttext, Inactiveborder, + /// Background in the (inactive) titlebar. Inactivecaption, + /// Text color in the (inactive) titlebar. Inactivecaptiontext, Infobackground, Infotext, @@ -450,14 +461,6 @@ pub enum SystemColor { #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] MozColheaderhovertext, - /// Color of text in the (active) titlebar. - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - MozGtkTitlebarText, - - /// Color of text in the (inactive) titlebar. - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - MozGtkTitlebarInactiveText, - #[css(skip)] End, // Just for array-indexing purposes. }