Bug 1698318 - Restrict a CSS hack to the windows native theme. r=mstange
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 15 Mar 2021 21:05:50 +0000
changeset 571326 847ac239d883f37fad58b9742e1fb66603635ec7
parent 571325 acd959de0b618f741b2d6ec7ccb86e53686c9914
child 571327 62e31d29d198457d30a54f53f59ed8949be678e5
push id38288
push usernbeleuzu@mozilla.com
push dateTue, 16 Mar 2021 05:27:46 +0000
treeherdermozilla-central@f2134bdaf09c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1698318, 1698043
milestone88.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1698318 - Restrict a CSS hack to the windows native theme. r=mstange Noticed this while working on bug 1698043. Differential Revision: https://phabricator.services.mozilla.com/D108339
layout/style/res/forms.css
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -898,38 +898,40 @@ input[type=number] {
   -moz-default-appearance: number-input;
 }
 
 input[type=number]::-moz-number-spin-box {
   writing-mode: horizontal-tb;
   display: flex;
   flex-direction: column;
   width: max-content;
-%ifdef XP_WIN
-  /* The Window's Theme's spin buttons have a very narrow minimum width, so
-   * make it something reasonable:
-   *
-   * TODO(emilio): Make this affect only when the non-native theme is disabled.
-   */
-  width: 16px;
-%endif
   /* If the spin-box has auto height, it ends up enlarging the default height
    * of the control, so we limit it to 1em here. The height doesn't affect
    * the rendering of the spinner-buttons; it's only for layout purposes.
    *
    * This is a temporary hack until we implement better positioning for the
    * spin-box in vertical mode; it works OK at default size but less well
    * if the font-size is made substantially larger or smaller. (Bug 1175074.)
    */
   height: 1em;
   max-height: 1em;
   align-self: center;
   justify-content: center;
 }
 
+%ifdef XP_WIN
+@media not (-moz-non-native-content-theme) {
+  input[type=number]::-moz-number-spin-box {
+    /* The Window's Theme's spin buttons have a very narrow minimum width, so
+     * make it something reasonable. */
+    width: 16px;
+  }
+}
+%endif
+
 input[type=number]::-moz-number-spin-up {
   writing-mode: horizontal-tb;
   appearance: auto;
   -moz-default-appearance: spinner-upbutton;
   display: block; /* bug 926670 */
   flex-grow: 1;
   cursor: default;
   /* Style for when native theming is off: */