Bug 482585. Move some XUL textbox-specific rules out of xul.css and into the relevant bindings. r=enn, sr=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 12 Mar 2009 10:16:33 -0400
changeset 26100 27cbf8dd3fbadc214fc2bbac0086f8a07c8acca2
parent 26099 6f6d4702729743491ffd34b9906d160dc43ef21e
child 26101 501d8a053dc93470578c72f5e7999e1b7d1e7b75
push idunknown
push userunknown
push dateunknown
reviewersenn, dbaron
bugs482585
milestone1.9.2a1pre
Bug 482585. Move some XUL textbox-specific rules out of xul.css and into the relevant bindings. r=enn, sr=dbaron
toolkit/content/jar.mn
toolkit/content/menulist.css
toolkit/content/textbox.css
toolkit/content/widgets/datetimepicker.xml
toolkit/content/widgets/menulist.xml
toolkit/content/widgets/textbox.xml
toolkit/content/xul.css
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -3,16 +3,18 @@ toolkit.jar:
 %  content global-platform %content/global-platform/ platform xpcnativewrappers=yes
 %  content global-region %content/global-region/ xpcnativewrappers=yes
 # provide the nsTransferable in nsDragAndDrop.js to extensions that have to
 # work with Geckos from before 1.9, when there was a separate file
 %  override chrome://global/content/nsTransferable.js chrome://global/content/nsDragAndDrop.js
 *  content/global/license.html                (license.html)
    content/global/XPCNativeWrapper.js         (XPCNativeWrapper.js)
 *  content/global/xul.css                     (xul.css)
+   content/global/textbox.css                 (textbox.css)
+   content/global/menulist.css                (menulist.css)
 *  content/global/about.xhtml                 (about.xhtml)
    content/global/directionDetector.html
    content/global/plugins.html
    content/global/plugins.css
 *+  content/global/buildconfig.html            (buildconfig.html)
 +  content/global/charsetOverlay.js           (charsetOverlay.js)
 +  content/global/charsetOverlay.xul          (charsetOverlay.xul)
 *+ content/global/commonDialog.js             (commonDialog.js)
new file mode 100644
--- /dev/null
+++ b/toolkit/content/menulist.css
@@ -0,0 +1,6 @@
+@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
+
+html|*.menulist-editable-input {
+  -moz-appearance: none !important;
+  background: transparent ! important;
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/content/textbox.css
@@ -0,0 +1,31 @@
+@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 */
+
+html|*.textbox-input {
+  -moz-appearance: none !important;
+  text-align: inherit;
+  text-shadow: inherit;
+}
+
+html|*.textbox-textarea {
+  -moz-appearance: none !important;
+  text-shadow: inherit;
+}
+
+textbox[empty="true"] html|*.textbox-input ,
+textbox[empty="true"] html|*.textbox-textarea {
+  text-align: left;
+  direction: ltr;
+}
+
+textbox[empty="true"][chromedir="rtl"] html|*.textbox-input ,
+textbox[empty="true"][chromedir="rtl"] html|*.textbox-textarea {
+  text-align: right;
+  direction: rtl;
+}
+
+textbox[empty="true"] html|*.textbox-input[emptytextdelay="true"] ,
+textbox[empty="true"] html|*.textbox-textarea[emptytextdelay="true"] {
+  color: transparent !important;
+}
+
--- a/toolkit/content/widgets/datetimepicker.xml
+++ b/toolkit/content/widgets/datetimepicker.xml
@@ -48,16 +48,17 @@
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="datetimepicker-base"
            extends="chrome://global/content/bindings/general.xml#basecontrol">
 
     <resources>
+      <stylesheet src="chrome://global/content/textbox.css"/>
       <stylesheet src="chrome://global/skin/textbox.css"/>
       <stylesheet src="chrome://global/skin/dropmarker.css"/>
       <stylesheet src="chrome://global/skin/datetimepicker.css"/>
     </resources>
 
     <content align="center">
       <xul:hbox class="datetimepicker-input-box" align="center"
                 xbl:inherits="context">
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -3,16 +3,17 @@
 <bindings id="menulistBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="menulist-base" extends="chrome://global/content/bindings/general.xml#basecontrol">
     <resources>
+      <stylesheet src="chrome://global/content/menulist.css"/>
       <stylesheet src="chrome://global/skin/menulist.css"/>
     </resources>
   </binding>
 
   <binding id="menulist" display="xul:menu"
            extends="chrome://global/content/bindings/menulist.xml#menulist-base">
     <content sizetopopup="pref">
       <xul:hbox class="menulist-label-box" flex="1">
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -10,16 +10,17 @@
 <bindings id="textboxBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="textbox" extends="xul:box">
     <resources>
+      <stylesheet src="chrome://global/content/textbox.css"/>
       <stylesheet src="chrome://global/skin/textbox.css"/>
     </resources>
 
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
         <html:input class="textbox-input" flex="1" anonid="input"
                     xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,tabindex,accesskey"/>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -658,44 +658,16 @@ textbox {
   -moz-user-select: text;
   text-shadow: none;
 }
 
 textbox[multiline="true"] {
   -moz-binding: url("chrome://global/content/bindings/textbox.xml#textarea");
 }
 
-html|*.textbox-input {
-  -moz-appearance: none !important;
-  text-align: inherit;
-  text-shadow: inherit;
-}
-
-html|*.textbox-textarea {
-  -moz-appearance: none !important;
-  text-shadow: inherit;
-}
-
-textbox[empty="true"] html|*.textbox-input ,
-textbox[empty="true"] html|*.textbox-textarea {
-  text-align: left;
-  direction: ltr;
-}
-
-textbox[empty="true"][chromedir="rtl"] html|*.textbox-input ,
-textbox[empty="true"][chromedir="rtl"] html|*.textbox-textarea {
-  text-align: right;
-  direction: rtl;
-}
-
-textbox[empty="true"] html|*.textbox-input[emptytextdelay="true"] ,
-textbox[empty="true"] html|*.textbox-textarea[emptytextdelay="true"] {
-  color: transparent !important;
-}
-
 .textbox-input-box {
   -moz-binding: url("chrome://global/content/bindings/textbox.xml#input-box");
 }
 
 .textbox-input-box[spellcheck="true"] {
   -moz-binding: url("chrome://global/content/bindings/textbox.xml#input-box-spell");
 }
 
@@ -844,21 +816,16 @@ menulist {
 menulist[editable="true"] {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-editable");
 }
 
 menulist[type="description"] {
   -moz-binding: url("chrome://global/content/bindings/menulist.xml#menulist-description");
 }
 
-html|*.menulist-editable-input {
-  -moz-appearance: none !important;
-  background: transparent ! important;
-}
-
 menulist > menupopup > menuitem {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic-noaccel");
 }
 
 dropmarker {
   -moz-binding: url("chrome://global/content/bindings/general.xml#dropmarker");
 }