1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 * This file should only contain a minimal set of rules for the XUL elements
7 * that may be implicitly created as part of HTML/SVG documents (e.g.
8 * scrollbars). Rules for everything else related to XUL can be found in
9 * xul.css. (This split of the XUL rules is to minimize memory use and improve
10 * performance in HTML/SVG documents.)
12 * ANYTHING ADDED TO THIS FILE WILL APPLY TO ALL DOCUMENTS, INCLUDING WEB CONTENT.
13 * IF UA RULES ARE ONLY NEEDED IN CHROME, THEY SHOULD BE ADDED TO xul.css.
16 @namespace url
("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
19 -moz-user-focus: ignore
;
22 box-sizing: border-box
;
25 /* hide the content and destroy the frame */
30 /* hide the content, but don't destroy the frames */
35 /* Rules required for style caching of anonymous content scrollbar parts */
36 @supports -moz-bool-pref
("layout.css.cached-scrollbar-styles.enabled") {
37 :is
(scrollcorner
, resizer
, scrollbar
, scrollbarbutton
, slider
):where
(:-moz-native-anonymous
) {
38 /* All scrollbar parts must not inherit any properties from the scrollable
39 * element (except for visibility and pointer-events), for the anonymous
40 * content style caching system to work.
44 pointer-events: inherit
;
46 /* These properties are not included in 'all'. */
47 -moz-context-properties: initial
;
48 -moz-control-character-visibility: initial
;
49 -moz-font-smoothing-background-color: initial
;
50 -moz-min-font-size-ratio: initial
;
51 -moz-box-layout: initial
;
53 /* As long as inert implies pointer-events: none as it does now, we're
57 /* Using initial is not sufficient for direction, since its initial value can
58 * depend on the document's language.
60 * LTR is what we want for all scrollbar parts anyway, so that e.g. we don't
61 * reverse the rendering of a horizontal scrollbar.
65 /* Similarly for font properties, whose initial values depend on the
66 * document's language. Scrollbar parts don't have any text or rely on
69 font: 16px sans-serif
;
71 /* The initial value of justify-items is `legacy`, which makes it depend on
74 * Reset it to something else.
78 /* Avoid `object > *` rule in html.css from setting a useless, non-initial
79 * value of vertical-align.
81 vertical-align: initial
!important
;
83 /* Duplicate the rules from the '*' rule above, which were clobbered by the
84 * 'all: initial' declaration.
86 * The other zero specificity rules above are on :root, and scrollbar parts
87 * cannot match :root, so no need to duplicate them.
89 -moz-user-focus: ignore
;
92 box-sizing: border-box
;
95 /* There are other rules that set the cursor on the scrollbar, expecting them
96 * to inherit into its children. Explicitly inherit it, overriding the
97 * 'all: initial;' declaration above.
99 :is
(scrollbarbutton
, slider
, thumb
):where
(:-moz-native-anonymous
) {
104 scrollbar
[orient
="vertical"],
105 slider
[orient
="vertical"],
106 thumb
[orient
="vertical"] {
107 -moz-box-orient: vertical
;
111 /* Prevent -moz-user-modify declaration from designmode.css having an
113 -moz-user-modify: initial
;
115 -moz-box-align: center
;
116 -moz-box-pack: center
;
119 /********** resizer **********/
124 /* Widget gets decide on its own whether or not the native theme should apply,
125 based on the context/OS theme. If it does not, SVG background will kick in. */
127 -moz-default-appearance: resizer
;
129 /* native resizer should never flip on its own;
130 we will flip it (or the SVG background) with CSS transform below. */
132 writing-mode: initial
;
134 background: url
("chrome://global/skin/icons/resizer.svg") no-repeat
;
135 background-size: 100% 100%;
141 /* bottomstart/bottomend is supported in XUL window only */
142 resizer
[dir
="bottom"][flip
],
143 resizer
[dir
="bottomleft"],
144 resizer
[dir
="bottomstart"]:-moz-locale-dir
(ltr
),
145 resizer
[dir
="bottomend"]:-moz-locale-dir
(rtl
) {
146 transform: scaleX
(-1);
149 resizer
[dir
="bottomleft"],
150 resizer
[dir
="bottomstart"]:-moz-locale-dir
(ltr
),
151 resizer
[dir
="bottomend"]:-moz-locale-dir
(rtl
) {
156 resizer
[dir
="bottom"] {
160 resizer
[dir
="left"] {
161 transform: scaleX
(-1);
165 resizer
[dir
="right"] {
169 resizer
[dir
="topleft"] {
173 resizer
[dir
="topright"] {
177 /********** scrollbar **********/
181 display: -moz-box
!important
;
184 /* Don't collapse thumb when scrollbar is disabled. */
185 thumb
[collapsed
="true"] {
189 scrollbar
, scrollbarbutton
, scrollcorner
, slider
, thumb
{
194 display: -moz-box
!important
;
197 scrollcorner
[hidden
="true"] {
198 display: none
!important
;
201 scrollbar
[value
="hidden"] {
205 @media (-moz-scrollbar-start-backward: 0) {
206 scrollbarbutton
[sbattr
="scrollbar-up-top"] {
211 @media (-moz-scrollbar-start-forward: 0) {
212 scrollbarbutton
[sbattr
="scrollbar-down-top"] {
217 @media (-moz-scrollbar-end-backward: 0) {
218 scrollbarbutton
[sbattr
="scrollbar-up-bottom"] {
223 @media (-moz-scrollbar-end-forward: 0) {
224 scrollbarbutton
[sbattr
="scrollbar-down-bottom"] {