/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Mozilla Communicator client code, released
 * March 31, 1998.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-1999
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Joe Hewitt (hewitt@netscape.com)
 *   Kevin Gerich (webmail@kmgerich.com)
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

menu,
menuitem {
  -moz-appearance: menuitem;
  -moz-box-align: center;
  color: MenuText;
  font: -moz-pull-down-menu;
  list-style-image: none;
  -moz-image-region: auto;
  padding: 0 21px 2px;
}

menu[disabled="true"], menuitem[disabled="true"],
menu[_moz-menuactive="true"][disabled="true"],
menuitem[_moz-menuactive="true"][disabled="true"] {
  color: -moz-mac-menutextdisable;
}

/* ..... internal content .... */

.menu-text,
.menu-iconic-text,
.menu-accel,
.menu-iconic-accel {
  margin: 0 !important;
}

.menu-text,
.menu-iconic-text {
  font-weight: inherit;
  color: inherit;
}

.menu-description {
  font-style: italic;
  color: -moz-mac-menutextdisable;
  -moz-margin-start: 1ex !important;
}

.menu-iconic-icon {
  height: 16px;
  margin-top: -2px;
  margin-bottom: -2px;
  -moz-margin-end: 5px;
  /* Empty icons shouldn't take up room, so we need to compensate
   * the 5px margin-end with a negative margin-start.
   */
  -moz-margin-start: -5px;
}

/* menuitems with icons */
.menuitem-iconic,
.menu-iconic,
menuitem[image],
menuitem[src] {
  /* 2px higher than those without icons */
  padding-top: 1px;
  padding-bottom: 3px;
}

.menuitem-iconic > .menu-iconic-left > .menu-iconic-icon,
.menu-iconic > .menu-iconic-left > .menu-iconic-icon,
menuitem[image] > .menu-iconic-left > .menu-iconic-icon,
menuitem[src] > .menu-iconic-left > .menu-iconic-icon {
  -moz-margin-start: 0;
  width: 16px;
}

/* ..... menu arrow box ..... */

.menu-right,
.menu-accel-container {
  -moz-margin-end: -9px;
  -moz-margin-start: 21px;
  -moz-box-pack: end;
}

.menu-right {
  width: 8px;
  list-style-image: url("chrome://global/skin/menu/menu-arrow.png");
  -moz-image-region: rect(0, 8px, 10px, 0);
}

.menu-right[_moz-menuactive="true"]:not([disabled="true"]) {
  -moz-image-region: rect(0, 16px, 10px, 8px);
}

.menu-right[disabled="true"] {
  -moz-image-region: rect(0, 24px, 10px, 16px);
}

.menu-right:-moz-locale-dir(rtl) {
  -moz-transform: scaleX(-1);
}

/* ::::: menu/menuitems in menubar ::::: */

menubar > menu {
  -moz-appearance: none !important;
  padding: 2px 5px 2px 7px;
  margin: 1px 0;
}

menubar > menu[_moz-menuactive="true"][open="true"] {
  -moz-appearance: menuitem !important;
  color: -moz-mac-menutextselect !important
}

/* ..... internal content .... */

.menubar-left {
  margin: 0 2px;
  color: inherit;
}

.menubar-text {
  margin: 0 1px !important;
  color: inherit;
}

/* ::::: menu/menuitems in popups ::::: */

menupopup > menu,
menupopup > menuitem {
  max-width: 42em;
}

menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"] {
  color: -moz-mac-menutextselect;
  background-color: Highlight;
}

/* ::::: menu/menuitems in menulist popups ::::: */

.menulist-menupopup > menuitem,
menulist > menupopup > menuitem,
.menulist-menupopup > menu,
menulist > menupopup > menu {
  max-width: none;
  font: inherit;
  color: -moz-FieldText;
}

/* ::::: menuitems in editable menulist popups ::::: */

menulist[editable="true"] > menupopup > menuitem {
  -moz-appearance: none;
}

menulist[editable="true"] > menupopup > menuitem > .menu-iconic-left {
  display: none;
}

/* ::::: checked menuitems ::::: */

:not(menulist) > menupopup > menuitem[checked="true"] > .menu-iconic-left,
:not(menulist) > menupopup > menuitem[selected="true"] > .menu-iconic-left {
  -moz-margin-start: -15px;
  -moz-padding-start: 15px;
  background: -moz-image-rect("chrome://global/skin/menu/menu-check.png", 0, 10, 11, 0) bottom left no-repeat transparent;
}

:not(menulist) > menupopup > menuitem[checked="true"] > .menu-iconic-left:-moz-locale-dir(rtl),
:not(menulist) > menupopup > menuitem[selected="true"] > .menu-iconic-left:-moz-locale-dir(rtl) {
  background-position: bottom right;
}

:not(menulist) > menupopup > menuitem[checked="true"][_moz-menuactive="true"] > .menu-iconic-left,
:not(menulist) > menupopup > menuitem[selected="true"][_moz-menuactive="true"] > .menu-iconic-left {
  background-image: -moz-image-rect("chrome://global/skin/menu/menu-check.png", 0, 20, 11, 10);
}

menulist:not([editable="true"]) > menupopup > menuitem[checked="true"]::before,
menulist:not([editable="true"]) > menupopup > menuitem[selected="true"]::before {
  content: '\2713'; /* a checkmark */
  display: block;
  width: 15px;
  -moz-margin-start: -15px;
}

/* ::::: menuseparator ::::: */

menuseparator {
  -moz-appearance: menuseparator;
  margin: 5px 0;
  padding: 1px 0 !important;
}

/* ::::: autocomplete ::::: */

.autocomplete-history-popup > menuitem {
  max-width: none !important;
  font: message-box;
}

/* ::::: tree column picker ::::: */

.treecell-popupcell-menu {
  margin-left: -2px;
  list-style-image: url("chrome://global/skin/columnselect.gif");
  -moz-image-region: auto;
}
