Bug 1796551 [wpt PR 36570] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / toolkit / content / minimal-xul.css
blob5b536e9e040da48e625e33b2597786185cd7d8b3
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/. */
5 /**
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 */
18 * {
19 -moz-user-focus: ignore;
20 user-select: none;
21 display: -moz-box;
22 box-sizing: border-box;
25 /* hide the content and destroy the frame */
26 [hidden="true"] {
27 display: none;
30 /* hide the content, but don't destroy the frames */
31 [collapsed="true"] {
32 visibility: collapse;
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.
42 all: initial;
43 visibility: inherit;
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;
52 math-depth: initial;
53 /* As long as inert implies pointer-events: none as it does now, we're
54 * good. */
55 -moz-inert: initial;
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.
63 direction: ltr;
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
67 * font metrics.
69 font: 16px sans-serif;
71 /* The initial value of justify-items is `legacy`, which makes it depend on
72 * the parent style.
74 * Reset it to something else.
76 justify-items: start;
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;
90 user-select: none;
91 display: -moz-box;
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) {
100 cursor: inherit;
104 scrollbar[orient="vertical"],
105 slider[orient="vertical"],
106 thumb[orient="vertical"] {
107 -moz-box-orient: vertical;
110 thumb {
111 /* Prevent -moz-user-modify declaration from designmode.css having an
112 * effect. */
113 -moz-user-modify: initial;
115 -moz-box-align: center;
116 -moz-box-pack: center;
119 /********** resizer **********/
121 resizer {
122 position: relative;
123 z-index: 2147483647;
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. */
126 appearance: auto;
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. */
131 direction: ltr;
132 writing-mode: initial;
134 background: url("chrome://global/skin/icons/resizer.svg") no-repeat;
135 background-size: 100% 100%;
136 cursor: se-resize;
137 width: 15px;
138 height: 15px;
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) {
152 cursor: sw-resize;
155 resizer[dir="top"],
156 resizer[dir="bottom"] {
157 cursor: ns-resize;
160 resizer[dir="left"] {
161 transform: scaleX(-1);
164 resizer[dir="left"],
165 resizer[dir="right"] {
166 cursor: ew-resize;
169 resizer[dir="topleft"] {
170 cursor: nw-resize;
173 resizer[dir="topright"] {
174 cursor: ne-resize;
177 /********** scrollbar **********/
179 thumb {
180 -moz-box-flex: 1;
181 display: -moz-box !important;
184 /* Don't collapse thumb when scrollbar is disabled. */
185 thumb[collapsed="true"] {
186 visibility: hidden;
189 scrollbar, scrollbarbutton, scrollcorner, slider, thumb {
190 user-select: none;
193 scrollcorner {
194 display: -moz-box !important;
197 scrollcorner[hidden="true"] {
198 display: none !important;
201 scrollbar[value="hidden"] {
202 visibility: hidden;
205 @media (-moz-scrollbar-start-backward: 0) {
206 scrollbarbutton[sbattr="scrollbar-up-top"] {
207 display: none;
211 @media (-moz-scrollbar-start-forward: 0) {
212 scrollbarbutton[sbattr="scrollbar-down-top"] {
213 display: none;
217 @media (-moz-scrollbar-end-backward: 0) {
218 scrollbarbutton[sbattr="scrollbar-up-bottom"] {
219 display: none;
223 @media (-moz-scrollbar-end-forward: 0) {
224 scrollbarbutton[sbattr="scrollbar-down-bottom"] {
225 display: none;