Bug 1348573 - Fix button text color in focused / active / checked states with High Contrast black and High Contrast white themes. r?gijs draft
authorDão Gottwald <dao@mozilla.com>
Sat, 25 Mar 2017 18:30:57 +0100
changeset 551323 4521e21cbba2edb3f4fc2b976a46cdf6584982a5
parent 551223 65b0ac174753b22c01156d72fb42d2abd3176dd1
child 621517 e9563a6edc3cadf6d27e1e3dc0b9e3e83b8fe8d2
push id51023
push userdgottwald@mozilla.com
push dateSat, 25 Mar 2017 17:31:48 +0000
reviewersgijs
bugs1348573
milestone55.0a1
Bug 1348573 - Fix button text color in focused / active / checked states with High Contrast black and High Contrast white themes. r?gijs MozReview-Commit-ID: BwEnPur1AJ5
toolkit/themes/windows/global/button.css
--- a/toolkit/themes/windows/global/button.css
+++ b/toolkit/themes/windows/global/button.css
@@ -32,23 +32,27 @@ button {
 }
 
 /* .......... focused state .......... */
 
 button:-moz-focusring > .button-box {
   border: 1px dotted ThreeDDarkShadow;
 }
 
-/* .......... default state .......... */
+/* .......... default/hover/focused state .......... */
 
 @media (-moz-windows-default-theme: 0) {
   @media (-moz-windows-compositor) {
-    /* This is for high-contrast themes on Windows 8 and later */
-    button[default="true"],
-    button:hover {
+    /* This is for high-contrast black and white themes on Windows 8 and later,
+       where the native appearance renders a different background (which
+       appears to be equivalent to the Highlight color) if the button is in the
+       default, hovered or focused state. However, if these states overlap with
+       the active, disabled, open or checked state, the appearance reverts back
+       to the default background. */
+    button:-moz-any([default="true"],:hover,:focus):not(:-moz-any(:active,[disabled="true"],[open="true"],[checked="true"])) {
       color: HighlightText;
     }
   }
 }
 
 /* .......... active/open/checked state .......... */
 
 button:hover:active > .button-box:-moz-system-metric(windows-classic),