Bug 1474258 - Remove the "listheader" binding and move the remaining styles to "richlistbox.css". r=bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Mon, 09 Jul 2018 12:45:41 +0100
changeset 815564 392ab9e0902127cb233eba601e7eaef8c00ad5ec
parent 815563 27df1b00c43b6f6769462b7359bcec089c702c0a
child 815570 21a401c24398675b4425580f17a66a0aad0e3ceb
push id115557
push userpaolo.mozmail@amadzone.org
push dateMon, 09 Jul 2018 11:48:29 +0000
reviewersbgrins
bugs1474258
milestone63.0a1
Bug 1474258 - Remove the "listheader" binding and move the remaining styles to "richlistbox.css". r=bgrins The content of this element is always overridden and the "xul:button" display mode is unnecessary, so the binding can be removed. The styles that control color are moved to "richlistbox.css" in preparation for the removal of the "listbox" element. MozReview-Commit-ID: 5pGVE6n34EL
layout/reftests/bugs/374719-1-css.css
toolkit/content/widgets/listbox.xml
toolkit/content/xul.css
toolkit/themes/linux/global/listbox.css
toolkit/themes/linux/global/richlistbox.css
toolkit/themes/osx/global/listbox.css
toolkit/themes/osx/global/richlistbox.css
toolkit/themes/windows/global/listbox.css
toolkit/themes/windows/global/richlistbox.css
--- a/layout/reftests/bugs/374719-1-css.css
+++ b/layout/reftests/bugs/374719-1-css.css
@@ -38,21 +38,17 @@ gridlikeboxbody {
 }
 
 gridlikecol {
   -moz-box-orient: vertical;
   min-width: 16px;
 }
 
 gridlikeheader {
-  -moz-binding: url("chrome://global/content/bindings/listbox.xml#listheader");
   -moz-box-ordinal-group: 2147483646;
-}
-
-gridlikeheader {
   -moz-appearance: treeheadercell;
   -moz-box-align: center;
   border: 2px solid;
   -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow;
   -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow;
   background-color: -moz-Dialog;
--- a/toolkit/content/widgets/listbox.xml
+++ b/toolkit/content/widgets/listbox.xml
@@ -1098,22 +1098,9 @@
 
     <content>
       <xul:listheaditem>
         <children includes="listheader"/>
       </xul:listheaditem>
     </content>
   </binding>
 
-  <binding id="listheader" display="xul:button">
-
-    <resources>
-      <stylesheet src="chrome://global/skin/listbox.css"/>
-    </resources>
-
-    <content>
-      <xul:image class="listheader-icon"/>
-      <xul:label class="listheader-label" xbl:inherits="value=label,crop" flex="1" crop="right"/>
-      <xul:image class="listheader-sortdirection" xbl:inherits="sortDirection"/>
-    </content>
-  </binding>
-
 </bindings>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -493,21 +493,16 @@ listrows {
 listitem {
   -moz-binding: url("chrome://global/content/bindings/listbox.xml#listitem");
 }
 
 listitem[type="checkbox"] {
   -moz-binding: url("chrome://global/content/bindings/listbox.xml#listitem-checkbox");
 }
 
-listheader {
-  -moz-binding: url("chrome://global/content/bindings/listbox.xml#listheader");
-  -moz-box-ordinal-group: 2147483646;
-}
-
 listcell {
   -moz-binding: url("chrome://global/content/bindings/listbox.xml#listcell");
 }
 
 listcell[type="checkbox"] {
   -moz-binding: url("chrome://global/content/bindings/listbox.xml#listcell-checkbox");
 }
 
@@ -900,20 +895,16 @@ richlistbox {
   -moz-user-focus: normal;
   -moz-box-orient: vertical;
 }
 
 richlistitem {
   -moz-binding: url('chrome://global/content/bindings/richlistbox.xml#richlistitem');
 }
 
-richlistbox > listheader {
-  -moz-box-ordinal-group: 1;
-}
-
 
 /*********** findbar ************/
 findbar {
   -moz-binding: url('chrome://global/content/bindings/findbar.xml#findbar');
   overflow-x: hidden;
 }
 
 .findbar-textbox {
--- a/toolkit/themes/linux/global/listbox.css
+++ b/toolkit/themes/linux/global/listbox.css
@@ -37,39 +37,16 @@ listitem[selected="true"] {
   color: -moz-cellhighlighttext;
 }
 
 listbox:focus > listitem[selected="true"] {
   background-color: Highlight;
   color: HighlightText;
 }
 
-/* ::::: listheader ::::: */
-
-listheader { 
-  -moz-appearance: treeheadercell;
-  -moz-box-align: center;
-  background-color: -moz-Dialog;
-  color: -moz-DialogText;
-}
-
-.listheader-icon {
-  margin-inline-end: 2px;
-}
-
-.listheader-label {
-  margin: 0 !important;
-}
-
-/* ..... sort direction icon ..... */
-
-.listheader-sortdirection {
-  -moz-appearance: treeheadersortarrow;
-}
-
 /* ::::: listcell ::::: */
 
 .listcell-label {
   margin: 0 !important;
   padding-top: 0;
   padding-bottom: 1px;
   padding-inline-start: 4px;
   padding-inline-end: 0;
--- a/toolkit/themes/linux/global/richlistbox.css
+++ b/toolkit/themes/linux/global/richlistbox.css
@@ -51,8 +51,13 @@ richlistbox.theme-listbox:not(:focus) > 
 richlistbox.theme-listbox > richlistitem > label {
   margin: 0px;
   padding-top: 0px;
   padding-bottom: 1px;
   padding-inline-start: 4px;
   padding-inline-end: 0px;
   white-space: nowrap;
 }
+
+listheader {
+  background-color: -moz-Dialog;
+  color: -moz-DialogText;
+}
--- a/toolkit/themes/osx/global/listbox.css
+++ b/toolkit/themes/osx/global/listbox.css
@@ -29,39 +29,16 @@ listitem[selected="true"] {
   color: -moz-DialogText;
 }
 
 listbox:focus > listitem[selected="true"] {
    background-color: Highlight;
    color: HighlightText;
 }
 
-/* ::::: listheader ::::: */
-
-listheader {
-  -moz-appearance: treeheadercell;
-  -moz-box-align: center;
-  color: -moz-DialogText;
-  padding: 0 4px;
-}
-
-listheader[sortable="true"]:hover:active {
-  padding-top: 1px;
-  padding-inline-start: 5px;
-  padding-inline-end: 4px;
-}
-
-.listheader-icon {
-  margin-inline-end: 2px;
-}
-
-.listheader-label {
-  margin: 0px !important;
-}
-
 /* ::::: listcell ::::: */
 
 .listcell-label {
   margin: 0px !important;
   padding-bottom: 1px;
   padding-inline-start: 4px;
   white-space: nowrap;
 }
--- a/toolkit/themes/osx/global/richlistbox.css
+++ b/toolkit/themes/osx/global/richlistbox.css
@@ -34,8 +34,12 @@ richlistbox.theme-listbox:not(:focus) > 
 }
 
 richlistbox.theme-listbox > richlistitem > label {
   margin: 0px;
   padding-bottom: 1px;
   padding-inline-start: 4px;
   white-space: nowrap;
 }
+
+listheader {
+  color: -moz-DialogText;
+}
--- a/toolkit/themes/windows/global/listbox.css
+++ b/toolkit/themes/windows/global/listbox.css
@@ -41,64 +41,16 @@ listitem[selected="true"] {
   color: -moz-cellhighlighttext;
 }
 
 listbox:focus > listitem[selected="true"] {
   background-color: Highlight;
   color: HighlightText;
 }
 
-/* ::::: listheader ::::: */
-
-listheader {
-  -moz-appearance: treeheadercell;
-  -moz-box-align: center;
-  color: -moz-DialogText;
-  padding: 0 4px;
-}
-
-listheader[sortable="true"]:hover:active {
-  padding-top: 1px;
-  padding-bottom: 0px;
-  padding-inline-start: 5px;
-  padding-inline-end: 4px;
-}
-
-.listheader-icon {
-  margin-inline-end: 2px;
-}
-
-.listheader-label {
-  margin: 0px !important;
-}
-
-/* ..... sort direction icon ..... */
-
-.listheader-sortdirection {
-  list-style-image: none;
-}
-
-.listheader-sortdirection[sortDirection="ascending"] {
-  list-style-image: url("chrome://global/skin/tree/sort-asc.png");
-}
-
-.listheader-sortdirection[sortDirection="descending"] {
-  list-style-image: url("chrome://global/skin/tree/sort-dsc.png");
-}
-
-@media (-moz-windows-classic) {
-  .listheader-sortdirection[sortDirection="ascending"] {
-    list-style-image: url("chrome://global/skin/tree/sort-asc-classic.png");
-  }
-
-  .listheader-sortdirection[sortDirection="descending"] {
-    list-style-image: url("chrome://global/skin/tree/sort-dsc-classic.png");
-  }
-}
-
 /* ::::: listcell ::::: */
 
 .listcell-label {
   margin: 0px !important;
   padding-top: 0px;
   padding-bottom: 1px;
   padding-inline-start: 4px;
   padding-inline-end: 0px;
--- a/toolkit/themes/windows/global/richlistbox.css
+++ b/toolkit/themes/windows/global/richlistbox.css
@@ -153,8 +153,12 @@ richlistbox.theme-listbox > richlistitem
       --listitem-selectedFocusColor: rgb(132,172,221);
       --listitem-selectedFocusBottomBorder: var(--listitem-selectedFocusColor);
       --listitem-selectedFocusBackground: rgba(131,183,249,.02);
       --listitem-selectedFocusImage: linear-gradient(rgba(131,183,249,.375), rgba(131,183,249,.375));
       --listitem-selectedFocusCurrentBackground: rgba(131,183,249,.15);
     }
   }
 }
+
+listheader {
+  color: -moz-DialogText;
+}