From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- layout/style/res/forms.css | 942 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 942 insertions(+) create mode 100644 layout/style/res/forms.css (limited to 'layout/style/res/forms.css') diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css new file mode 100644 index 0000000000..cde72c0d21 --- /dev/null +++ b/layout/style/res/forms.css @@ -0,0 +1,942 @@ +/* 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; + overflow-clip-box: 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 and ::-moz-button-content below. */ + 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; +} + +/* 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; +} + +/* 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 . + Note -moz-focus-inner padding does not affect button size. */ + padding-block: 1px; + padding-inline: 8px; + border: 2px outset ButtonBorder; + background-color: ButtonFace; + cursor: default; + box-sizing: border-box; + user-select: none; +} + +/* Text-related properties for buttons: these ones are not shared with + input[type=color] */ +button, +::file-selector-button, +input:is([type=reset], [type=button], [type=submit]) { + color: ButtonText; + font: -moz-button; + white-space: pre; + text-align: center; + overflow-clip-box: padding-box; +} + +input[type=color] { + inline-size: 64px; + block-size: 32px; +} + +@media (-moz-non-native-content-theme) { + button, + ::file-selector-button, + input:is([type=reset], [type=button], [type=submit]) { + padding-inline: 4px; + } + + input[type=color] { + padding: 4px; + } +} + +button, +::file-selector-button { + /* Buttons should lay out like "normal" html, mostly */ + white-space: unset; + text-indent: 0; + /* But no text-decoration reaching inside, by default */ + display: inline-block; +} + +*|*::-moz-button-content { + display: block; + /* Please keep the declarations below in sync with ::-moz-scrolled-content in + ua.css and ::-moz-fieldset-content above. */ + 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; +} + +::file-selector-button:hover, +button:hover, +input:is([type=reset], [type=button], [type=submit], [type=color]):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; + color: -moz-buttonactivetext; + background-color: -moz-buttonactiveface; +} + +::-moz-focus-inner { + /* Note this padding only affects the -moz-focus-inner ring, not the button itself */ + padding-block: 0; + padding-inline: 2px; + border: 1px dotted transparent; +} + +:focus-visible::-moz-focus-inner { + border-color: currentColor; +} + +:is(:disabled, :disabled:active)::file-selector-button, +button:is(:disabled, :disabled:active), +input:is([type=reset], [type=button], [type=submit], [type=color]):is(:disabled, :disabled:active), +select:is(:disabled, :disabled:active) > button { + border-style: outset; + cursor: unset; +} + +:is(:disabled, :disabled:active)::file-selector-button, +button:is(:disabled, :disabled:active), +input:is([type=reset], [type=button], [type=submit]):is(:disabled, :disabled:active), +select:is(:disabled, :disabled:active) > button { + color: GrayText; + background-color: -moz-ButtonDisabledFace; +} + +/* file selector */ +input[type=file] { + white-space: nowrap !important; + overflow: hidden !important; + overflow-clip-box: padding-box; + color: unset; + + /* Revert rules which apply on all inputs. */ + appearance: none; + -moz-default-appearance: none; + cursor: default; + + border: none; + background-color: transparent; + padding: unset; +} + +input[type=file] > label { + display: inline-block; + min-inline-size: 12em; + text-align: match-parent; + + color: unset; + font-size: unset; + letter-spacing: 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: + * + *