/*
 * ***** 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 XForms support.
 *
 * The Initial Developer of the Original Code is
 * IBM Corporation.
 * Portions created by the Initial Developer are Copyright (C) 2005
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * 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.w3.org/2002/xforms);
@namespace xf url(http://www.w3.org/2002/xforms);
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@namespace mozType url(http://www.mozilla.org/projects/xforms/2005/type);

rebuild,
recalculate,
revalidate,
refresh,
model,
instance,
submission,
bind,
value,
copy,
setvalue,
send,
load,
dispatch,
setfocus,
toggle,
insert,
delete,
setindex {
  display: none !important;
}

html|*:root repeat,
html|*:root repeatitem,
html|*:root contextcontainer,
html|*:root group:not(:disabled),
html|*:root switch:not(:disabled),
html|*:root case,
html|*:root select1:not([appearance]) item,
html|*:root select1[appearance='minimal'] item,
select1[appearance="full"] item,
select[appearance="full"] item,
html|*:root select1:not([appearance]) itemset,
html|*:root select1[appearance='minimal'] itemset,
select1[appearance="full"] itemset,
select[appearance="full"] itemset,
html|*:root select1:not([appearance]) choices,
html|*:root select1[appearance='minimal'] choices,
select1[appearance="full"] choices,
select[appearance="full"] choices {
  display: block;
}

/* default MIP styling */
*:disabled,
xf|*[mozType|rejectedtype="true"] {
  display: none;
}

xul|*:root output:not(:disabled),
xul|*:root label:not(:disabled),
xul|*:root input:not(:disabled),
xul|*:root secret:not(:disabled),
xul|*:root textarea:not(:disabled),
xul|*:root trigger:not(:disabled),
xul|*:root submit:not(:disabled),
xul|*:root upload:not(:disabled),
xul|*:root repeat:not(:disabled),
xul|*:root repeatitem,
xul|*:root contextcontainer,
xul|*:root group:not(:disabled),
xul|*:root switch:not(:disabled),
xul|*:root case {
  display: -moz-box;
}

html|*:root select[appearance="full"] itemset contextcontainer,
html|*:root select1[appearance="full"] itemset contextcontainer {
  display: inline;
}

contextcontainer-inline {
  display: inline;
}

xul|*:root select1:not([appearance]) item,
xul|*:root select1[appearance='minimal'] item,
select1[appearance='compact'] item,
select:not([appearance="full"]) item,
xul|*:root select1:not([appearance]) itemset,
xul|*:root select1[appearance='minimal'] itemset,
select1[appearance='compact'] itemset,
select:not([appearance="full"]) itemset,
xul|*:root select1:not([appearance]) choices,
xul|*:root select1[appearance='minimal'] choices,
select1[appearance='compact'] choices,
select:not([appearance="full"]) choices {
  display: none;
}

message, alert, help {
  display: none;
}

mediatype {
  -moz-binding: url('chrome://xforms/content/xforms.xml#xformswidget-mediatype');
  display: none;
}

html|*:root message[level="ephemeral"], html|*:root hint {
  position: absolute;
  z-index: 2147481647;
  visibility: hidden;
  top: 0px;
  left: 0px;
  width: 0px;
  height: 0px;
  display: block;
}

html|*:root alert {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-alert');
}
xul|*:root alert {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-alert');
}

html|*:root hint {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-hint');
}

html|*:root message[level="ephemeral"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-ephemeral-message');
}
xul|*:root message[level="ephemeral"], xul|*:root hint {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-ephemeral-message');
}

html|*:root message[level="ephemeral"], html|*:root hint {
  background-color: InfoBackground;
  color: InfoText;
  border: 1px black solid;
  padding: 2px 3px;
  font: message-box;
  width: auto;
  height: auto;
  display: block;
}

html|*:root message[level="ephemeral"] > html|div.-moz-xforms-message-container,
html|*:root hint > html|div.-moz-xforms-message-container {
  background-color: inherit;
  color: inherit;
  border: inherit;
  padding: inherit;
  font: inherit;
  position: inherit;
  width: inherit;
  height: inherit;
  display: inherit;
  z-index: 2147483647;
}

/* group */
group {
  -moz-binding: url('chrome://xforms/content/xforms.xml#xformswidget-accessors');
}

/* output widgets */
html|*:root output {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output');
}

xul|*:root output {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-output');
}

  /* output type='xsd:date', appearance='full' */
html|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-date-full');
}
html|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"]
    html|span[mozType|calendar] {
  -moz-binding: url('chrome://xforms/content/widgets-xhtml.xml#calendar-full');
}

xul|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"] {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-output-date-full');
}
xul|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"]
    xul|box[mozType|calendar] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#calendar-full');
}

  /* output mediatype="image/*" */
html|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#anyURI"][mozType|mediatype^="image"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-anyURI');
}
html|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#base64Binary"][mozType|mediatype^="image"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-base64Binary');
}

xul|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#anyURI"][mozType|mediatype^="image"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-anyURI');
}
xul|*:root output[mozType|typelist~="http://www.w3.org/2001/XMLSchema#base64Binary"][mozType|mediatype^="image"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-base64Binary');
}

  /* output mediatype="text/html", mediatype="application/xhtml+xml" */
html|*:root output[mozType|mediatype="text/html"],
html|*:root output[mozType|mediatype="application/xhtml+xml"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-output-mediatype-texthtml');
}

/* range widgets */
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#decimal"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#float"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#double"] {
  -moz-binding: url('chrome://xforms/content/range-xhtml.xml#xformswidget-range-numeric');
}

html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#decimal"] html|span[mozType|slider],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#float"] html|span[mozType|slider],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#double"] html|span[mozType|slider] {
  -moz-binding: url('chrome://xforms/content/widgets-xhtml.xml#slider');
}

  /* range widgets (Dates and Times) */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#dateTime"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#dateTime"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#time"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#time"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gDay"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gDay"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonth"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonth"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonthDay"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonthDay"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYear"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYear"],
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYearMonth"],
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYearMonth"],
xul|*:root range[mozType|type="http://www.w3.org/2002/xforms#yearMonthDuration"],
html|*:root range[mozType|type="http://www.w3.org/2002/xforms#yearMonthDuration"],
xul|*:root range[mozType|type="http://www.w3.org/2002/xforms#dayTimeDuration"],
html|*:root range[mozType|type="http://www.w3.org/2002/xforms#dayTimeDuration"] {
  -moz-binding: url('chrome://xforms/content/range-xul.xml#xformswidget-range-datesandtimes');
}

  /* range type="xsd:dateTime" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#dateTime"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#dateTime"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-datetime');
}

  /* range type="xsd:date" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-date');
}

  /* range type="xsd:time" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#time"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#time"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-time');
}

  /* range type="xsd:gDay" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gDay"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gDay"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-gday');
}

  /* range type="xsd:gMonth" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonth"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonth"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-gmonth');
}

  /* range type="xsd:gMonthDay" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonthDay"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonthDay"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-gmonthday');
}

  /* range type="xsd:gYear" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYear"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYear"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-gyear');
}

  /* range type="xsd:gYearMonth" */
xul|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYearMonth"] > xul|box,
html|*:root range[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gYearMonth"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-gyearmonth');
}

  /* range type="xf:yearMonthDuration" */
xul|*:root range[mozType|type="http://www.w3.org/2002/xforms#yearMonthDuration"] > xul|box,
html|*:root range[mozType|type="http://www.w3.org/2002/xforms#yearMonthDuration"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-yearmonthduration');
}

  /* range type="xf:dayTimeDuration" */
xul|*:root range[mozType|type="http://www.w3.org/2002/xforms#dayTimeDuration"] > xul|box,
html|*:root range[mozType|type="http://www.w3.org/2002/xforms#dayTimeDuration"] > xul|box {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#range-daytimeduration');
}

range xul|box.xf-value {
  -moz-box-align: end;
  -moz-box-orient: horizontal;
}

/* input widgets */

  /* input */
html|*:root input {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input');
}

xul|*:root input {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input');
}

  /* input type="xsd:boolean" */
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#boolean"] {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input-boolean');
}

xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#boolean"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-boolean');
}

  /* input type="xsd:date" */
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] html|span[mozType|calendar] {
  -moz-binding: url('chrome://xforms/content/widgets-xhtml.xml#calendar-full');
  z-index: 2147481647;
}

html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input-date');
}

xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-date');
}

xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"] xul|box[mozType|calendar] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#calendar-full');
}

  /* input type="xsd:date", appearance="full" */
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"] {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input-date-full');
}

xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#date"][appearance="full"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-date-full');
}

  /* input type="xsd:gMonth" */
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gMonth"] {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input-month');
}

  /* input type="xsd:gDay" */
html|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#gDay"] {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-input-day');
}

  /* input type="xsd:integer" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#integer"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-integer');
}
  /* input type="xsd:nonPositiveInteger" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#nonPositiveInteger"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-nonPositiveInteger');
}
  /* input type="xsd:negativeInteger" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#negativeInteger"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-negativeInteger');
}
  /* input type="xsd:long" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#long"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-long');
}
  /* input type="xsd:int" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#int"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-int');
}
  /* input type="xsd:short" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#short"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-short');
}
  /* input type="xsd:byte" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#byte"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-byte');
}
  /* input type="xsd:nonNegativeInteger" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#nonNegativeInteger"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-nonNegativeInteger');
}
  /* input type="xsd:unsignedLong" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#unsignedLong"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-unsignedLong');
}
  /* input type="xsd:unsignedInt" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#unsignedInt"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-unsignedInt');
}
  /* input type="xsd:unsignedShort" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#unsignedShort"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-unsignedShort');
}
  /* input type="xsd:unsignedByte" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#unsignedByte"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-unsignedByte');
}
  /* input type="xsd:positiveInteger" */
xul|*:root input[mozType|typelist~="http://www.w3.org/2001/XMLSchema#positiveInteger"] {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-input-positiveInteger');
}

/* secret widgets */
html|*:root secret {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-secret');
}

xul|*:root secret {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-secret');
}

/* textarea widgets */
html|*:root textarea {
  -moz-binding: url('chrome://xforms/content/input-xhtml.xml#xformswidget-textarea');
}

xul|*:root textarea {
  -moz-binding: url('chrome://xforms/content/input-xul.xml#xformswidget-textarea');
}

/* trigger and submit widgets */
html|*:root trigger, html|*:root submit {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-trigger');
}

xul|*:root trigger, xul|*:root submit {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-trigger');
}

html|*:root trigger[appearance="minimal"], html|*:root submit[appearance="minimal"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-trigger-minimal');
}

xul|*:root trigger[appearance="minimal"], xul|*:root submit[appearance="minimal"] {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-trigger-minimal');
}

trigger[appearance="minimal"]:hover, submit[appearance="minimal"]:hover {
  cursor: pointer;
}

/* Most of the trigger[appearance="minimal"] specific CSS is copied from toolbarbutton.css */
xul|*:root trigger[appearance="minimal"],
xul|*:root submit[appearance="minimal"] {
  -moz-appearance: toolbarbutton;
  -moz-box-align: center;
  -moz-box-pack: center;
  margin: 0;
  border: 1px solid transparent;
  padding: 3px;
  background-color: transparent;
  color: -moz-DialogText;
  cursor: default;
}
xul|*:root trigger[appearance="minimal"]:focus,
xul|*:root submit[appearance="minimal"]:focus {
  -moz-appearance: toolbarbutton;
  outline: 1px dotted -moz-DialogText;
  -moz-outline-offset: -2px;
}
xul|*:root trigger[appearance="minimal"]:hover,
xul|*:root submit[appearance="minimal"]:hover {
  border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;
}
xul|*:root trigger[appearance="minimal"]:hover:active,
xul|*:root submit[appearance="minimal"]:hover:active {
  border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;
  padding-top: 4px;
  padding-bottom: 2px;
  -moz-padding-start: 4px;
  -moz-padding-end: 2px;
}
xul|*:root trigger[appearance="minimal"][disabled],
xul|*:root trigger[appearance="minimal"][disabled]:hover,
xul|*:root trigger[appearance="minimal"][disabled]:hover:active,
xul|*:root submit[appearance="minimal"][disabled],
xul|*:root submit[appearance="minimal"][disabled]:hover,
xul|*:root submit[appearance="minimal"][disabled]:hover:active {
  border-color: transparent;
  padding: 3px;
  color: GrayText !important;
}

/* label widgets */
html|*:root input[accesskey] > label,
html|*:root secret[accesskey] > label,
html|*:root textarea[accesskey] > label,
html|*:root trigger[accesskey] > label,
html|*:root submit[accesskey] > label,
html|*:root select[accesskey] > label,
html|*:root select1[accesskey] > label,
html|*:root upload[accesskey] > label,
html|*:root range[accesskey] > label {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-label-accesskey');
}

/* label widgets */
xul|*:root input[accesskey] > label,
xul|*:root secret[accesskey] > label,
xul|*:root textarea[accesskey] > label,
xul|*:root trigger[accesskey] > label,
xul|*:root submit[accesskey] > label,
xul|*:root select[accesskey] > label,
xul|*:root select1[accesskey] > label,
xul|*:root upload[accesskey] > label,
xul|*:root range[accesskey] > label {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-label-accesskey');
}

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

html|span.xf-accesskey-appended:before {
  content: "(";
}
html|span.xf-accesskey-appended:after {
  content: ")";
}

html|*:root label {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-label');
}

xul|*:root label {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-label');
}
xul|*:root input label, xul|*:root secret label, xul|*:root textarea label,
xul|*:root select > label, xul|*:root select1 > label {
  padding-top: 4px;
}

/* switch/case widgets */
xul|*:root switch {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-switch');
}
html|*:root case {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-case');
}

html|*:root switch {
  -moz-binding: url('chrome://xforms/content/xforms.xml#xformswidget-accessors');
}
xul|*:root case {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-case');
}

  /* switch/case styles */
html|*:root case > html|div.-moz-xforms-case-container {
  display: inherit;
}

xul|*:root case xul|box[anonid="control"] {
  -moz-box-orient: inherit;
}

/* select, select1 widgets */

  /* itemset widget */
select1 itemset, select itemset {
  -moz-binding: url('chrome://xforms/content/selects.xml#itemset');
}

  /* choices widget */
html|*:root select1:not([appearance]) choices,
html|*:root select1[appearance='minimal'] choices,
select[appearance='full'] choices,
select1[appearance='full'] choices {
  -moz-binding: url('chrome://xforms/content/selects.xml#choices');
}

  /* select1 appearance='minimal' (default) */
html|*:root select1:not([appearance]),
html|*:root select1[appearance='minimal'] {
  -moz-binding: url('chrome://xforms/content/select1.xml#xformswidget-select1');
}
html|*:root select1:not([appearance]) item,
html|*:root select1[appearance='minimal'] item {
  -moz-binding: url('chrome://xforms/content/select1.xml#xformswidget-select1-item');
  white-space : nowrap;
}

xul|*:root select1 {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#select1-minimal');
}
xul|*:root select1 xul|box[anonid="nativewidget"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#nativewidget-select1-minimal');
}

  /* select1 appearance='compact' */
html|*:root select1[appearance="compact"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xhtml.xml#select1');
}
html|*:root select1[appearance="compact"] html|span[anonid="nativewidget"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xhtml.xml#nativewidget-select1-compact');
}

xul|*:root select1[appearance="compact"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#select1');
}
xul|*:root select1[appearance="compact"] xul|box[anonid="nativewidget"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#nativewidget-select1-compact');
}

  /* select1 appearance='full' */
html|*:root select1[appearance="full"] {
  -moz-binding: url('chrome://xforms/content/selects-xhtml.xml#select1-full');
}
html|*:root select1[appearance="full"] item {
  -moz-binding: url('chrome://xforms/content/selects-xhtml.xml#select1-full-item');
}

xul|*:root select1[appearance="full"] {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select1-full');
}
xul|*:root select1[appearance="full"] xul|radiogroup {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select1-full-radiogroup') !important;
}

xul|*:root select1[appearance="full"] item {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select1-full-item');
}
xul|*:root select1[appearance="full"] item xul|radio {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select1-full-item-radio') !important;
}

/* select1[appearance='minimal'] for xhtml styles (most of the select1 specific
CSS is copied from forms.css) */

html|*:root html|input.-moz-xforms-select1-input,
html|*:root html|input.-moz-xforms-date-input {
  border: 1px dotted transparent;
  margin-right: 0px;
  padding: 0px;
  font: -moz-list;
  -moz-box-sizing: border-box;
  height: 1.3em;
  line-height: normal !important;
}

html|*:root html|input.-moz-xforms-select1-input:focus {
  border: 1px dotted black;
}

html|*:root html|span.-moz-date-container,
html|*:root html|span.-moz-select1-container {
  margin: 0px;
  margin-bottom: 1px;
  border-color: ThreeDFace;
  background-color: -moz-Field;
  color: -moz-FieldText;
  font: -moz-list;
  line-height: normal !important;
  white-space: nowrap !important;
  text-align: start;
  cursor: default;
  -moz-box-sizing: border-box;
  -moz-appearance: menulist;
  border-style: inset;
  text-indent: 0;
  padding-right: 0px;
  overflow: hidden;
  border-width: 2px;
  padding-bottom: 1px;
  padding-top: 1px;
}

html|*:root html|div.-moz-xforms-select1-popup {
  border-width: 1px;
  top: 0px;
  left: 0px;
  border: 1px outset black !important;
  background-color: -moz-Field;
  font: -moz-list;
  text-align: start;
  visibility: hidden;
  overflow-y: auto;
  overflow-x: hidden;
  position: absolute;
  -moz-user-select: none;
  z-index: 2147482647;
  cursor: default;
}

html|*:root item[_moz_active] {
  color: HighlightText;
  background: Highlight;
}

/* styles for select1[appearance="minimal", select1[appearance="full"],
  select[appearance="full"] */
html|*:root select1:not([appearance]) choices > label,
html|*:root select1[appearance='minimal'] choices > label,
select[appearance="full"] choices > label,
select1[appearance="full"] choices > label {
  display: block;
  font: -moz-list;
  line-height: normal !important;
  font-style: italic;
  font-weight: bold;
  -moz-user-select: none;
  text-indent: 0;
}

html|*:root select1:not([appearance]) choices > item,
html|*:root select1:not([appearance]) choices > itemset,
html|*:root select1:not([appearance]) choices > choices,
html|*:root select1[appearance='minimal'] choices > item,
html|*:root select1[appearance='minimal'] choices > itemset,
html|*:root select1[appearance='minimal'] choices > choices,
select[appearance="full"] choices > item,
select[appearance="full"] choices > itemset,
select[appearance="full"] choices > choices,
select1[appearance="full"] choices > item,
select1[appearance="full"] choices > itemset,
select1[appearance="full"] choices > choices {
  padding-left: 20px;
}

  /* select appearance="compact" (default) */
html|*:root select {
  -moz-binding: url('chrome://xforms/content/selectsnw-xhtml.xml#select');
}
html|*:root select html|span[anonid="nativewidget"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xhtml.xml#nativewidget-select-compact');
}

xul|*:root select {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#select');
}
xul|*:root select xul|box[anonid="nativewidget"] {
  -moz-binding: url('chrome://xforms/content/selectsnw-xul.xml#nativewidget-select-compact');
}

  /* select appearance="full" */
html|*:root select[appearance="full"] {
  -moz-binding: url('chrome://xforms/content/selects-xhtml.xml#select-full');
}
html|*:root select[appearance="full"] item {
  -moz-binding: url('chrome://xforms/content/selects-xhtml.xml#select-full-item');
}

xul|*:root select[appearance="full"] {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select-full');
}
xul|*:root select[appearance="full"] item {
  -moz-binding: url('chrome://xforms/content/selects-xul.xml#select-full-item');
}

  /* select, select1 styles*/

/* XXX: selectors are wrong, styles don't work (bug 351797). */
xul|*:root select1[appearance="full"] xul|box xul|radiogroup:focus xul|radio[selected] + label,
xul|*:root select[appearance="full"] xul|box xul|checkbox:focus + label {
  /* Don't specify the outline-color, we should always use initial value. */
  outline: 1px dotted;
}

xul|*:root select[appearance="full"] xul|*.checkbox-label-box,
xul|*:root select1[appearance="full"] xul|*.radio-label-box {
  display: none;
}

xul|*:root select, xul|*:root select1 {
  display: -moz-box;
  margin: 2px 4px;
}

xul|*:root select1 item label {
  margin: 2px 4px;
  padding-top: 1px;
  padding-bottom: 1px;
}

item[disabled] label {
  color: graytext;
}

/* upload widgets */
html|*:root upload {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-upload-disabled');
}

xul|*:root upload {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-upload-disabled');
}

html|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#anyURI"],
html|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#base64Binary"],
html|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#hexBinary"] {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-upload');
  display: inline;
}

xul|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#anyURI"],
xul|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#base64Binary"],
xul|*:root upload[mozType|typelist~="http://www.w3.org/2001/XMLSchema#hexBinary"] {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-upload');
}

/* repeat widgets */
*|*[xf|repeat-bind] {
  -moz-binding: url('chrome://xforms/content/xforms.xml#xformswidget-attr-repeat');
}

*|*[xf|repeat-nodeset] {
  -moz-binding: url('chrome://xforms/content/xforms.xml#xformswidget-attr-repeat');
}

html|*:root repeat {
  -moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-repeat');
}

xul|*:root repeat {
  -moz-binding: url('chrome://xforms/content/xforms-xul.xml#xformswidget-repeat');
}

/* repeat styles */
html|*:root repeat[appearance="compact"] .xf-repeat-item {
  display: inline;
}

xul|*:root repeat[appearance="compact"] *|*[anonid="insertion"] {
  -moz-box-orient: horizontal;
}
xul|*:root repeat .xf-repeat-item {
  -moz-box-flex: 1;
}

/* native widgets */
html|*:root html|input[mozType|dropmarker] {
  -moz-binding: url('chrome://xforms/content/widgets-xhtml.xml#dropmarker');
}

xul|*:root xul|dropmarker[mozType|dropmarker] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#dropmarker');
}

html|*:root html|div[mozType|comboboxpopup] {
  -moz-binding: url('chrome://xforms/content/widgets-xhtml.xml#comboboxpopup');
}

  /* spinbuttons widget */
xul|spinbuttons {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#spinbuttons');
}

  /* numberbox widget */
xul|textbox[type="number"] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#numberbox');
  display: -moz-box;
}

  /* monthbox widget */
xul|textbox[type="month"] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#monthbox');
  display: -moz-box;
}

xul|hbox[mozType|monthyearbox] {
  -moz-binding: url('chrome://xforms/content/widgets-xul.xml#monthyearbox');
}

