Bug 1885489 - Part 5: Add SnapshotIterator::readInt32(). r=iain
[gecko.git] / toolkit / content / xul.css
blob908132d598083dd43ee62940f4bac84e49238c92
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 * Rules for everything related to XUL except scrollbars can be found in this
7 * file.
9 * This file should also not contain any app specific styling. Defaults for
10 * widgets of a particular application should be in that application's style
11 * sheet. For example, style definitions for browser can be found in
12 * browser.css.
15 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
16 @namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
18 * {
19 -moz-user-focus: ignore;
20 display: flex;
21 box-sizing: border-box;
24 /* hide the content and destroy the frame */
25 [hidden="true"] {
26 display: none;
29 /* hide the content, but don't destroy the frames */
30 [collapsed="true"] {
31 visibility: collapse;
34 /* TODO: investigate unifying these two root selectors
35 * https://bugzilla.mozilla.org/show_bug.cgi?id=1592344
37 *|*:root {
38 --animation-easing-function: cubic-bezier(.07, .95, 0, 1);
39 flex: 1;
40 -moz-box-collapse: legacy;
43 :root {
44 text-rendering: optimizeLegibility;
45 -moz-control-character-visibility: visible;
46 width: 100%;
47 height: 100%;
48 user-select: none;
51 :root:-moz-locale-dir(rtl) {
52 direction: rtl;
55 /* XUL doesn't show outlines by default */
56 :focus-visible {
57 outline: initial;
61 * Native anonymous popups and tooltips in html are document-level, which means
62 * that they don't inherit from the root, so this is needed.
64 popupgroup:-moz-native-anonymous:-moz-locale-dir(rtl),
65 tooltip:-moz-native-anonymous:-moz-locale-dir(rtl) {
66 direction: rtl;
69 /* ::::::::::
70 :: Rules for 'hiding' portions of the chrome for special
71 :: kinds of windows (not JUST browser windows) with toolbars
72 ::::: */
74 *|*:root[chromehidden~="menubar"] .chromeclass-menubar,
75 *|*:root[chromehidden~="directories"] .chromeclass-directories,
76 *|*:root[chromehidden~="status"] .chromeclass-status,
77 *|*:root[chromehidden~="extrachrome"] .chromeclass-extrachrome,
78 *|*:root[chromehidden~="location"] .chromeclass-location,
79 *|*:root[chromehidden~="location"][chromehidden~="toolbar"] .chromeclass-toolbar,
80 *|*:root[chromehidden~="toolbar"] .chromeclass-toolbar-additional {
81 display: none;
84 /* ::::::::::
85 :: Rules for forcing direction for entry and display of URIs
86 :: or URI elements
87 ::::: */
89 .uri-element {
90 direction: ltr !important;
93 /****** elements that have no visual representation ******/
95 script, data, commandset, command,
96 broadcasterset, broadcaster, observes,
97 keyset, key, toolbarpalette, template,
98 treeitem, treeseparator, treerow, treecell {
99 display: none;
102 /********** focus rules **********/
104 button,
105 checkbox,
106 menulist,
107 radiogroup,
108 richlistbox,
109 tree,
110 browser,
111 editor,
112 iframe,
113 label:is(.text-link, [onclick]),
114 tab[selected="true"]:not([ignorefocus="true"]) {
115 -moz-user-focus: normal;
118 /* Avoid losing focus on tabs by keeping them focusable, since some browser
119 * tests rely on this.
121 * TODO(emilio): Remove this and fix the tests / front-end code:
122 * * browser/base/content/test/general/browser_tabfocus.js
124 tab:focus {
125 -moz-user-focus: normal;
128 /******** window & page ******/
130 window {
131 overflow: clip;
132 flex-direction: column;
135 /******** box *******/
137 vbox {
138 flex-direction: column;
141 /********** label **********/
143 label {
144 display: inline-block;
147 description {
148 display: flow-root;
151 label html|span.accesskey {
152 text-decoration: underline;
153 text-decoration-skip-ink: none;
156 description:where([value]) {
157 /* Preserves legacy behavior, maybe could be removed */
158 display: flex;
161 label:where([value]) {
162 /* Preserves legacy behavior, maybe could be removed */
163 display: inline-flex;
166 :is(label, description)[value] {
167 white-space: nowrap;
170 :is(label, description)[value]::before {
171 /* This displays the value attribute, along with the underlined
172 * accesskey if needed */
173 content: -moz-label-content;
174 display: block;
177 label[value=""]::before {
178 content: "\200b" !important; /* zwsp */
181 :is(label, description)[value][crop] {
182 min-width: 0;
185 :is(label, description)[value][crop]::before {
186 min-width: 0;
187 max-width: 100%;
188 /* This implements crop=end */
189 overflow: hidden;
190 text-overflow: ellipsis;
193 /* Invert the direction to clip at the start rather than end */
194 :is(label, description)[value][crop="start"]::before {
195 direction: rtl;
196 /* Mark text as ltr to preserve punctuation/numeric order */
197 content: "\200e" -moz-label-content;
200 :is(label, description)[value][crop="start"]:-moz-locale-dir(rtl)::before {
201 direction: ltr;
202 /* Mark text as rtl to preserve punctuation/numeric order */
203 content: "\200f" -moz-label-content;
206 .checkbox-label-box,
207 .radio-label-box {
208 min-width: 0;
211 /********** toolbarbutton **********/
213 toolbarbutton {
214 align-items: center;
215 justify-content: center;
218 toolbarbutton.tabbable {
219 -moz-user-focus: normal !important;
222 toolbarbutton[crop] {
223 min-width: 0;
226 .toolbarbutton-text {
227 display: block;
228 text-align: center;
231 toolbar[mode="icons"] .toolbarbutton-text,
232 toolbar[mode="text"] .toolbarbutton-icon,
233 html|label.toolbarbutton-badge:empty {
234 display: none;
237 .toolbarbutton-icon,
238 .toolbarbutton-text,
239 .toolbarbutton-badge-stack,
240 .toolbarbutton-menu-dropmarker,
241 .treecol-text,
242 .treecol-sortdirection,
243 .menubar-left,
244 .menubar-text,
245 .menu-text,
246 .menu-iconic-text,
247 .menu-iconic-highlightable-text,
248 .menu-iconic-left,
249 .menu-right,
250 .menu-accel-container,
251 .button-box {
252 /* Preserves legacy behavior */
253 pointer-events: none;
256 /********** button **********/
258 button {
259 -moz-default-appearance: button;
260 appearance: auto;
263 dropmarker {
264 -moz-default-appearance: -moz-menulist-arrow-button;
265 appearance: auto;
268 /******** browser, editor, iframe ********/
270 browser,
271 editor,
272 iframe {
273 display: inline;
276 /* Allow the browser to shrink below its intrinsic size, to match legacy
277 * behavior */
278 browser {
279 align-self: stretch;
280 justify-self: stretch;
281 min-height: 0;
282 min-width: 0;
283 contain: size;
286 /*********** popup notification ************/
287 popupnotification {
288 flex-direction: column;
291 .popup-notification-menubutton:not([label]) {
292 display: none;
295 /********** radio **********/
297 radiogroup {
298 flex-direction: column;
301 /******** groupbox *********/
303 groupbox {
304 flex-direction: column;
307 /******** draggable elements *********/
309 toolbar:not([nowindowdrag="true"], [customizing="true"]) {
310 -moz-window-dragging: drag;
313 /* The list below is non-comprehensive and will probably need some tweaking. */
314 toolbaritem,
315 toolbarbutton,
316 toolbarseparator,
317 button,
318 search-textbox,
319 html|input,
320 tab,
321 radio,
322 splitter,
323 menu,
324 menulist {
325 -moz-window-dragging: no-drag;
328 titlebar {
329 pointer-events: auto !important;
332 /******* toolbar *******/
334 toolbox {
335 flex-direction: column;
338 @media (-moz-platform: macos) {
339 toolbar[type="menubar"] {
340 min-height: 0 !important;
341 border: 0 !important;
345 toolbarspring {
346 flex: 1000 1000;
349 /********* menu ***********/
351 menubar > menu:empty {
352 visibility: collapse;
355 .menu-text {
356 flex: 1;
359 /********* menupopup, panel, & tooltip ***********/
361 menupopup,
362 panel,
363 tooltip {
364 position: fixed;
365 -moz-top-layer: top;
366 width: fit-content;
367 height: fit-content;
368 /* Make sure that popups are interactable when shown, since they escape the
369 * usual layering rules */
370 -moz-inert: none;
371 /* Popups can't have overflow */
372 contain: paint;
373 z-index: 2147483647;
374 text-shadow: none;
377 tooltip {
378 appearance: auto;
379 -moz-default-appearance: tooltip;
381 white-space: pre-wrap;
383 background-color: InfoBackground;
384 color: InfoText;
385 font: message-box;
386 padding: 2px 3px;
387 max-width: 40em;
388 overflow: clip;
389 pointer-events: none;
393 * It's important that these styles are in a UA sheet, because the default
394 * tooltip is native anonymous content
396 @media (-moz-platform: linux) {
397 tooltip {
398 padding: 6px 10px; /* Matches Adwaita. */
399 line-height: 1.4; /* For Noto Sans; note that 1.2 may clip descenders. */
403 @media (-moz-platform: macos) {
404 tooltip {
405 padding: 2px 6px; /* Matches native metrics. */
409 @media (-moz-platform: windows) {
410 tooltip {
411 appearance: none;
412 border: 1px solid;
415 /* TODO(emilio): Probably make InfoText/InfoBackground do the right thing and
416 * remove this? */
417 @media not (prefers-contrast) {
418 tooltip {
419 background-color: #f9f9fb;
420 color: black;
421 border-color: #67676c;
422 border-radius: 4px;
425 @media (prefers-color-scheme: dark) {
426 tooltip {
427 background-color: #2b2a33;
428 color: white;
429 border-color: #f9f9fb;
435 /******** tree ******/
437 treecolpicker {
438 order: 2147483646;
441 treechildren {
442 display: flex;
443 flex: 1;
446 tree {
447 flex-direction: column;
450 tree[hidecolumnpicker="true"] treecolpicker {
451 display: none;
454 treecol {
455 min-width: 16px;
456 /* This preserves the behavior of -moz-box-ordinal-group. To change this we'd
457 * need to migrate the persisted ordinal values etc. */
458 order: 1;
461 treecol[hidden="true"] {
462 visibility: collapse;
463 display: flex;
466 /* ::::: lines connecting cells ::::: */
467 tree:not([treelines="true"]) treechildren::-moz-tree-line {
468 visibility: hidden;
471 treechildren::-moz-tree-cell(ltr) {
472 direction: ltr !important;
475 /********** deck, tabpanels & stack *********/
477 tabpanels > *|*:not(:-moz-native-anonymous) {
478 /* tabpanels is special: we want to avoid displaying them, but we still want
479 * the hidden children to be accessible */
480 -moz-subtree-hidden-only-visually: 1;
483 deck > *|*:not(:-moz-native-anonymous) {
484 visibility: hidden;
487 tabpanels > .deck-selected,
488 deck > .deck-selected {
489 -moz-subtree-hidden-only-visually: 0;
490 visibility: inherit;
493 tabpanels,
494 deck,
495 stack {
496 display: grid;
497 position: relative;
500 /* We shouldn't style native anonymous children like scrollbars or what not. */
501 tabpanels > *|*:not(:-moz-native-anonymous),
502 deck > *|*:not(:-moz-native-anonymous),
503 stack > *|*:not(:-moz-native-anonymous) {
504 grid-area: 1 / 1;
505 z-index: 0;
508 The default `min-height: auto` value makes grid items refuse to be smaller
509 than their content. This doesn't match the traditional behavior of XUL stack,
510 which often shoehorns tall content into a smaller stack and allows the content
511 to decide how to handle overflow (e.g. by scaling down if it's an image, or
512 by adding scrollbars if it's scrollable).
514 min-height: 0;
517 /********** tabbox *********/
519 tabbox {
520 flex-direction: column;
521 min-height: 0;
524 tabpanels {
525 min-height: 0;
528 tabs {
529 flex-direction: row;
532 tab {
533 align-items: center;
534 justify-content: center;
537 /********** tooltip *********/
539 tooltip[titletip="true"] {
540 /* The width of the tooltip isn't limited on cropped <tree> cells. */
541 max-width: none;
544 /********** basic rule for anonymous content that needs to pass box properties through
545 ********** to an insertion point parent that holds the real kids **************/
547 .box-inherit {
548 align-items: inherit;
549 justify-content: inherit;
550 flex-grow: inherit;
551 flex-shrink: inherit;
552 flex-direction: inherit;
555 /********** textbox **********/
557 search-textbox {
558 text-shadow: none;
561 /* Prefix with (xul|*):root to workaround HTML tests loading xul.css */
562 :root html|textarea:not([resizable="true"]) {
563 resize: none;
566 /********** autocomplete textbox **********/
568 .autocomplete-richlistbox {
569 -moz-user-focus: ignore;
570 overflow-x: hidden !important;
571 flex: 1;
574 .autocomplete-richlistitem {
575 flex-direction: column;
576 align-items: center;
577 overflow: clip;
580 /* The following rule is here to fix bug 96899 (and now 117952).
581 Somehow trees create a situation
582 in which a popupset flows itself as if its popup child is directly within it
583 instead of the placeholder child that should actually be inside the popupset.
584 This is a stopgap measure, and it does not address the real bug. */
585 .autocomplete-result-popupset {
586 max-width: 0px;
587 width: 0 !important;
588 min-width: 0%;
589 min-height: 0%;
592 /********** menulist **********/
594 menulist[popuponly] {
595 appearance: none !important;
596 margin: 0 !important;
597 height: 0 !important;
598 min-height: 0 !important;
599 border: 0 !important;
600 padding: 0 !important;
603 /********** splitter **********/
605 .tree-splitter {
606 margin-inline: -4px;
607 width: 8px;
608 max-width: 8px;
609 min-width: 8px;
610 appearance: none !important;
611 border: none !important;
612 background: none !important;
613 order: 2147483646;
614 z-index: 2147483646;
617 /******** scrollbar ********/
619 slider {
620 /* This is a hint to layerization that the scrollbar thumb can never leave
621 the scrollbar track. */
622 overflow: hidden;
625 /******** scrollbox ********/
627 scrollbox {
628 /* This makes it scrollable! */
629 overflow: hidden;
632 @media (prefers-reduced-motion: no-preference) {
633 scrollbox[smoothscroll=true] {
634 scroll-behavior: smooth;
638 /********** stringbundle **********/
640 stringbundle,
641 stringbundleset {
642 display: none;
645 /********** dialog **********/
647 dialog {
648 flex: 1;
649 flex-direction: column;
652 /********** wizard **********/
654 wizard {
655 flex: 1;
656 flex-direction: column;
657 contain: inline-size;
658 min-width: 40em;
659 min-height: 30em;
662 wizard > wizardpage {
663 grid-area: 1 / 1;
664 min-height: 0;
667 wizard > wizardpage:not(.selected) {
668 visibility: hidden;
671 wizardpage {
672 flex-direction: column;
673 overflow: auto;
676 /********** Rich Listbox ********/
678 richlistbox {
679 flex-direction: column;
680 overflow: auto;
681 min-width: 0;
682 min-height: 0;
685 richlistitem {
686 flex-shrink: 0;
689 /*********** findbar ************/
690 findbar {
691 overflow-x: hidden;
692 contain: inline-size;
695 /* Some elements that in HTML blocks should be inline-level by default */
696 button, image {
697 display: inline-flex;
700 .menu-iconic-highlightable-text:not([highlightable="true"]),
701 .menu-iconic-text[highlightable="true"] {
702 display: none;
705 [orient="vertical"] { flex-direction: column !important; }
706 [orient="horizontal"] { flex-direction: row !important; }
708 [align="start"] { align-items: flex-start !important; }
709 [align="center"] { align-items: center !important; }
710 [align="end"] { align-items: flex-end !important; }
711 [align="baseline"] { align-items: baseline !important; }
712 [align="stretch"] { align-items: stretch !important; }
714 [pack="start"] { justify-content: start !important; }
715 [pack="center"] { justify-content: center !important; }
716 [pack="end"] { justify-content: flex-end !important; }
718 [flex="0"] { flex: none !important; }
719 [flex="1"] { flex: 1 !important; }