Bug 1484680 - Remove treenode-checkbox binding. r=philipp
☠☠ backed out by 84f675096b81 ☠ ☠
authorArshad Khan <arshdkhn1@gmail.com>
Mon, 20 Aug 2018 18:30:13 +0530
changeset 33137 2dc8e39bc37f5aebdd85a237f5d6287db6c606ab
parent 33136 4658bcf16f8d845be88098294ae34a0029f77ca4
child 33138 1e38647496aeae774fefde1a554f9508e9dd31d2
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersphilipp
bugs1484680
Bug 1484680 - Remove treenode-checkbox binding. r=philipp
calendar/base/content/agenda-listbox.xml
calendar/base/content/widgets/calendar-widget-bindings.css
calendar/base/content/widgets/calendar-widgets.xml
calendar/base/themes/common/widgets/calendar-widgets.css
calendar/lightning/content/messenger-overlay-sidebar.xul
--- a/calendar/base/content/agenda-listbox.xml
+++ b/calendar/base/content/agenda-listbox.xml
@@ -35,17 +35,17 @@
           onMouseOverItem(event);
       ]]></handler>
     </handlers>
   </binding>
 
   <binding id="agenda-checkbox-richlist-item"
            extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
     <content>
-      <xul:treenode-checkbox class="agenda-checkbox" anonid="agenda-checkbox-widget"
+      <xul:checkbox class="agenda-checkbox treenode-checkbox" anonid="agenda-checkbox-widget"
                                                    flex="1"
                                                    xbl:inherits="selected,label,hidden,disabled"/>
     </content>
     <implementation>
       <field name="kCheckbox">null</field>;
       <constructor><![CDATA[
           this.kCheckbox = document.getAnonymousElementByAttribute(this, "anonid", "agenda-checkbox-widget");
 
--- a/calendar/base/content/widgets/calendar-widget-bindings.css
+++ b/calendar/base/content/widgets/calendar-widget-bindings.css
@@ -1,15 +1,12 @@
 /* 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/. */
 
-treenode-checkbox {
-  -moz-binding: url("chrome://calendar/content/widgets/calendar-widgets.xml#treenode-checkbox");
-}
 
 modebox,
 modevbox {
   -moz-binding: url(chrome://calendar/content/widgets/calendar-widgets.xml#modebox);
   -moz-user-focus: normal;
 }
 
 modevbox {
--- a/calendar/base/content/widgets/calendar-widgets.xml
+++ b/calendar/base/content/widgets/calendar-widgets.xml
@@ -43,29 +43,25 @@
         <body><![CDATA[
             let dayNumber = cal.l10n.getDateFmtString(`day.${cal.dtz.now().day}.number`);
             document.getAnonymousElementByAttribute(this, "anonid", "day-label").value = dayNumber;
         ]]></body>
       </method>
     </implementation>
    </binding>
 
-  <!-- this binding directly extends to a checkbox but is visualized as
-       a treenode in a treecontrol-->
-  <binding id="treenode-checkbox" extends="chrome://global/content/bindings/checkbox.xml#checkbox"/>
-
   <!-- this binding directly extends to a xul:box element and enriches this with some functionality: It is designed
       to be displayed only 1) in given application modes (e.g "task" mode, "calendar" mode) and 2) only in relation
       to the "checked" attribute of command or a checkbox control.
     - The attribute "mode" denotes a coma-separated list of all modes that the binding should not be collapsed in,
       e.g. mode="calendar,task"
     - The attribute "broadcaster" points to the id of a broadcaster that is supposed to be notified (by the application)
       as soon as the mode changes. When this happens the modebox" will be notified and will check if it should
       collapse itself or not.
-    - The attribute "refcontrol" points to a control either a "command", "checkbox" or a "treenode-checkbox" or other
+    - The attribute "refcontrol" points to a control either a "command", "checkbox" or other
       elements that support a "checked" attribute that is often used to denote whether a modebox is supposed to be
       displayed or not. If "refcontrol" is set to the id of a command you can there set the oncommend attribute like:
       "oncommand='document.getElementById('my-mode-pane').togglePane(event)'. In case it is a checkbox element or derived
       checkbox element this is done automatically by listening to the event "CheckboxChange";
       So if the current application mode is one of the modes listed in the "mode" attribute it is
       additionally verified if the xul-element denoted by "refcontrol" is checked or not. During runtime an attribute named
       "collapsedinmodes" with the collpsed modes comma-separated e.g. "mail,calendar,task. This attribute is also made
       persistent-->
@@ -77,18 +73,17 @@
       <field name="mControlHandler">null</field>;
 
       <constructor><![CDATA[
           if (this.hasAttribute("broadcaster")) {
               this.setAttribute("broadcaster", this.getAttribute("broadcaster"));
           }
           if (this.hasAttribute("refcontrol")) {
               this.mRefControl = document.getElementById(this.getAttribute("refcontrol"));
-              if (this.mRefControl && ((this.mRefControl.localName == "treenode-checkbox") ||
-                                    (this.mRefControl.localName == "checkbox"))) {
+              if (this.mRefControl && (this.mRefControl.localName == "checkbox")) {
                   this.mControlHandler = {
                       binding: this,
                       handleEvent: function(aEvent, aHandled) {
                           return this.binding.onCheckboxStateChange(aEvent, this.binding);
                       }
                   };
                   this.mRefControl.addEventListener("CheckboxStateChange", this.mControlHandler, true);
               }
--- a/calendar/base/themes/common/widgets/calendar-widgets.css
+++ b/calendar/base/themes/common/widgets/calendar-widgets.css
@@ -1,52 +1,52 @@
 /* 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/. */
 
-treenode-checkbox {
+checkbox.treenode-checkbox {
   -moz-box-align: center;
   padding-top: 4px;
   padding-inline-start: 4px;
   padding-inline-end: 4px;
   font-weight: bold;
 }
 
-treenode-checkbox > .checkbox-check {
+checkbox.treenode-checkbox > .checkbox-check {
   -moz-appearance: none;
   -moz-box-align: center;
   border: none;
   width: 8px; /* The image's width is 8 pixels */
   height: 8px;
   background: url(chrome://global/skin/icons/twisty-collapsed.svg) center no-repeat;
   -moz-context-properties: fill;
   fill: currentColor;
 }
 
-treenode-checkbox[checked="true"] > .checkbox-check {
+checkbox.treenode-checkbox[checked="true"] > .checkbox-check {
   background-image: url("chrome://global/skin/icons/twisty-expanded.svg");
 }
 
-treenode-checkbox:-moz-locale-dir(rtl) > .checkbox-check {
+checkbox.treenode-checkbox:-moz-locale-dir(rtl) > .checkbox-check {
   background-image: url("chrome://global/skin/icons/twisty-collapsed-rtl.svg");
 }
 
 .checkbox-label-box {
   margin-inline-start: 4px;
 }
 
 .checkbox-icon {
   margin-inline-end: 2px;
 }
 
 .checkbox-label {
   margin: 0 !important;
 }
 
-treenode-checkbox > .checkbox-label-center-box > .checkbox-label-box > .checkbox-label {
+checkbox.treenode-checkbox > .checkbox-label-center-box > .checkbox-label-box > .checkbox-label {
   font-weight: bold;
   border-bottom: 1px solid -moz-Dialog;
 }
 
 .view-navigation-button {
   -moz-context-properties: fill;
   fill: currentColor;
   list-style-image: url(chrome://calendar-common/skin/view-cycler.svg);
--- a/calendar/lightning/content/messenger-overlay-sidebar.xul
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xul
@@ -145,17 +145,17 @@
               <hbox id="calMinimonthBox" pack="center">
                 <minimonth id="calMinimonth" onchange="minimonthPick(this.value);" freebusy="true"/>
               </hbox>
             </vbox>
           </modevbox>
           <separator id="minimonth-splitter" minwidth="100"/>
           <vbox id="calendar-panel" flex="1">
             <modevbox id="task-filter-pane" mode="task" broadcaster="modeBroadcaster" refcontrol="calendar_toggle_filter_command">
-              <treenode-checkbox id="task-tree-filter-header"
+              <checkbox id="task-tree-filter-header"
                                checked="true"
                                class="treenode-checkbox"
                                label="&calendar.task.filter.title.label;"/>
               <modevbox id="task-filtertree-pane" flex="1" mode="task" broadcaster="modeBroadcaster" refcontrol="task-tree-filter-header">
                  <radiogroup id="task-tree-filtergroup" class="task-tree-subpane"
                              persist="value">
                    <observes element="filterBroadcaster"
                              attribute="value"
@@ -168,17 +168,17 @@
                    <radio id="opt_completed_filter" label="&calendar.task.filter.completed.label;" value="completed" command="calendar_task_filter_command"/>
                    <radio id="opt_open_filter" label="&calendar.task.filter.open.label;" value="open" command="calendar_task_filter_command"/>
                    <radio id="opt_all_filter" label="&calendar.task.filter.all.label;" value="all" command="calendar_task_filter_command"/>
                  </radiogroup>
               </modevbox>
             </modevbox>
             <modevbox id="calendar-list-pane" flex="1" mode="calendar,task" broadcaster="modeBroadcaster"
                       refcontrol="calendar_toggle_calendarlist_command">
-              <treenode-checkbox id="calendar-list-header"
+              <checkbox id="calendar-list-header"
                                checked="true"
                                class="treenode-checkbox"
                                ondrop="return document.getElementById('calendar-list-tree-widget').foreignDrop(event)"
                                ondragenter="return document.getElementById('calendar-list-tree-widget').foreignCanDrop(event)"
                                ondragover="return document.getElementById('calendar-list-tree-widget').foreignCanDrop(event)"
                                label="&calendar.list.header.label;"/>
               <modevbox id="calendar-listtree-pane" flex="1" mode="calendar,task" broadcaster="modeBroadcaster"
                         refcontrol="calendar-list-header">