/* 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/. */

/**
 * This file should only contain a minimal set of rules for the XUL elements
 * that may be implicitly created as part of HTML/SVG documents (e.g.
 * scrollbars).  Rules for everything else related to XUL can be found in
 * xul.css.  (This split of the XUL rules is to minimize memory use and improve
 * performance in HTML/SVG documents.)
 *
 * This file should also not contain any app specific styling.  Defaults for
 * widgets of a particular application should be in that application's style
 * sheet.  For example style definitions for navigator can be found in
 * navigator.css.
 *
 * THIS FILE IS LOCKED DOWN.  YOU ARE NOT ALLOWED TO MODIFY IT WITHOUT FIRST
 * HAVING YOUR CHANGES REVIEWED BY enndeakin@gmail.com
 */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */

* {
  -moz-user-focus: ignore;
  -moz-user-select: none;
  display: -moz-box;
  box-sizing: border-box;
}

:root {
  text-rendering: optimizeLegibility;
  -moz-binding: url("chrome://global/content/bindings/general.xml#root-element");
  -moz-control-character-visibility: visible;
}

:root:-moz-locale-dir(rtl) {
  direction: rtl;
}

/* hide the content and destroy the frame */
[hidden="true"] {
  display: none;
}

/* hide the content, but don't destroy the frames */
[collapsed="true"],
[moz-collapsed="true"] {
  visibility: collapse;
}

/********** label **********/

description {
  -moz-binding: url("chrome://global/content/bindings/text.xml#text-base");
}

label {
  -moz-binding: url("chrome://global/content/bindings/text.xml#text-label");
}

label.text-link, label[onclick] {
  -moz-binding: url("chrome://global/content/bindings/text.xml#text-link");
  -moz-user-focus: normal;
}

label[control], label.radio-label, label.checkbox-label, label.toolbarbutton-multiline-text {
  -moz-binding: url("chrome://global/content/bindings/text.xml#label-control");
}

html|span.accesskey {
  text-decoration: underline;
}

/********** resizer **********/

resizer {
  -moz-binding: url("chrome://global/content/bindings/resizer.xml#resizer");
  position: relative;
  z-index: 2147483647;
}

/********** scrollbar **********/

/* Scrollbars are never flipped even if BiDI kicks in. */
scrollbar[orient="horizontal"] {
  direction: ltr;
}

thumb {
  -moz-binding: url(chrome://global/content/bindings/scrollbar.xml#thumb);
  display: -moz-box !important;
}

.scale-thumb {
  -moz-binding: url(chrome://global/content/bindings/scale.xml#scalethumb);
}

scrollbar, scrollbarbutton, scrollcorner, slider, thumb, scale {
  -moz-user-select: none;
}

scrollcorner {
  display: -moz-box !important;
}

scrollcorner[hidden="true"] {
  display: none !important;
}

scrollbar[value="hidden"] {
  visibility: hidden;
}

scale {
  -moz-binding: url(chrome://global/content/bindings/scale.xml#scale);
}

.scale-slider {
  -moz-binding: url(chrome://global/content/bindings/scale.xml#scaleslider);
  -moz-user-focus: normal;
}

scrollbarbutton[sbattr="scrollbar-up-top"]:not(:-moz-system-metric(scrollbar-start-backward)),
scrollbarbutton[sbattr="scrollbar-down-top"]:not(:-moz-system-metric(scrollbar-start-forward)),
scrollbarbutton[sbattr="scrollbar-up-bottom"]:not(:-moz-system-metric(scrollbar-end-backward)),
scrollbarbutton[sbattr="scrollbar-down-bottom"]:not(:-moz-system-metric(scrollbar-end-forward)) {
  display: none;
}

thumb[sbattr="scrollbar-thumb"]:-moz-system-metric(scrollbar-thumb-proportional) {
  -moz-box-flex: 1;
}
