/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** Styles for old GFX form widgets **/ @namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */ *|*::-moz-fieldset-content { display: block; /* StyleAdjuster::adjust_for_fieldset_content overrides this in some cases */ unicode-bidi: inherit; text-overflow: inherit; overflow: inherit; resize: inherit; /* Need to inherit border-radius too, so when the fieldset has rounded borders we don't leak out the corners for hit-testing purposes. */ border-radius: inherit; padding: inherit; box-decoration-break: inherit; block-size: 100%; /* Need this so percentage block-sizes of kids work right */ /* Please keep the declarations below in sync with ::-moz-scrolled-content in ua.css. */ content: inherit; /* Multicol container */ column-count: inherit; column-width: inherit; column-gap: inherit; column-rule: inherit; column-fill: inherit; /* Flex container */ flex-direction: inherit; flex-wrap: inherit; /* -webkit-box container (aliased from -webkit versions to -moz versions) */ -moz-box-orient: inherit; -moz-box-direction: inherit; -moz-box-pack: inherit; -moz-box-align: inherit; /* Grid container */ grid-auto-columns: inherit; grid-auto-rows: inherit; grid-auto-flow: inherit; grid-column-gap: inherit; grid-row-gap: inherit; grid-template-areas: inherit; grid-template-columns: inherit; grid-template-rows: inherit; /* CSS Align */ align-content: inherit; align-items: inherit; justify-content: inherit; justify-items: inherit; /* Text box */ text-box-trim: inherit; text-box-edge: inherit; } /* Miscellaneous form elements */ legend { display: block; padding-inline: 2px; } fieldset { display: block; margin-inline: 2px; padding-block: 0.35em 0.625em; padding-inline: 0.75em; border: 2px groove ThreeDFace; min-inline-size: min-content; } label { cursor: default; /* If you add declarations here, consider whether the select > label and file * input label need them as well. */ } /* Default inputs, text inputs, and selects */ /* Note: Values in nsNativeTheme IsWidgetStyled function need to match textfield background/border values here */ input { display: inline-block; appearance: auto; -moz-default-appearance: textfield; /* The sum of border and padding on block-start and block-end must be the same here, for buttons, and for as not selectable. */ user-select: none; } /* stylelint-disable-next-line selector-pseudo-element-no-unknown */ select::picker-icon { display: inline-block; appearance: auto; -moz-default-appearance: -moz-menulist-arrow-button; content: "\feff"; pointer-events: none; -webkit-text-security: none; max-block-size: 100%; /* Make sure to align properly with the display frame. Note that we want the * baseline of the combobox to match the baseline of the label, so the * dropmarker is what gets the vertical-align. */ vertical-align: top; } /* NOTE(emilio): The :not(:-moz-select-list-box) is needed, for now, because * this rule otherwise would be less specific than the [popover] rules. * We should probably find a better solution than this (probably ::picker() * should be more specific? Or we could use cascade layers). See also * https://github.com/w3c/csswg-drafts/issues/13108 */ /* stylelint-disable-next-line selector-pseudo-element-no-unknown */ select:not(:-moz-select-list-box)::picker(select) { box-sizing: border-box; border: 1px solid; padding: 0; /* color intentionally inherits here so that options into the picker inherit * the . */ padding-block: 1px; padding-inline: 8px; border: 2px outset ButtonBorder; background-color: ButtonFace; cursor: default; box-sizing: border-box; break-inside: avoid; @media -moz-pref("layout.forms.button-input-align-content-block.enabled") { align-content: center; } } /* Disable text-selection by default, for button-flavored input elements (including the file-selector button for input[type="file"]) */ ::file-selector-button, input:where([type="color"], [type="reset"], [type="button"], [type="submit"]) { user-select: none; } /* Text-related properties for buttons: these ones are not shared with input[type=color] */ button, ::file-selector-button, input:where([type="reset"], [type="button"], [type="submit"]) { color: ButtonText; font: -moz-button; white-space: pre; text-align: center; padding-inline: 4px; } input[type="color"] { inline-size: 64px; block-size: 32px; padding: 4px; } /* https://github.com/whatwg/html/issues/9976 */ input:not([type="range" i], [type="checkbox" i], [type="radio" i]) { overflow: clip !important; overflow-clip-margin: 0 !important; } input[type="image" i] { overflow-clip-margin: content-box !important; } button, ::file-selector-button { /* Buttons should lay out like "normal" html, mostly */ white-space: unset; /* But no text-decoration reaching inside, by default */ display: inline-block; } ::file-selector-button:hover, button:hover, input:where([type="reset"], [type="button"], [type="submit"], [type="color"]):hover { color: -moz-buttonhovertext; border-color: -moz-buttonhoverborder; background-color: -moz-buttonhoverface; } ::file-selector-button:active:hover, button:active:hover, input:where([type="reset"], [type="button"], [type="submit"], [type="color"]):active:hover { border-style: inset; border-color: -moz-buttonactiveborder; color: -moz-buttonactivetext; background-color: -moz-buttonactiveface; } :is(:disabled, :disabled:active)::file-selector-button, button:is(:disabled, :disabled:active), input:where([type="reset"], [type="button"], [type="submit"], [type="color"]):is(:disabled, :disabled:active) { border-style: outset; cursor: unset; } :is(:disabled, :disabled:active)::file-selector-button, button:is(:disabled, :disabled:active), input:where([type="reset"], [type="button"], [type="submit"]):is(:disabled, :disabled:active) { color: GrayText; background-color: -moz-ButtonDisabledFace; } /* file selector */ input[type="file"] { white-space: nowrap !important; color: unset; /* Revert rules which apply on all inputs. */ appearance: none; -moz-default-appearance: none; cursor: default; border: none; background-color: transparent; padding: unset; } ::-moz-file-content { display: inline-block; min-inline-size: 12em; text-align: match-parent; cursor: unset; user-select: none; unicode-bidi: plaintext; } /* button part of file selector */ ::file-selector-button { font-size: unset; letter-spacing: unset; cursor: unset; margin-inline-end: 5px; } /* * Make form controls inherit 'unicode-bidi' transparently as required by * their various anonymous descendants and pseudo-elements: * *