Bug 1503826 - Remove the treerows binding, r=bgrins
authorVictor Porof <vporof@mozilla.com>
Thu, 17 Jan 2019 10:53:53 +0100
changeset 454537 47e7e2dac7c99f9c5fa555bdb579ec18f1674c72
parent 454536 5f4b3423f6fefaeffaf130898b2384756f22877f
child 454538 c46ddfb551e684d0b774aa21b825c2be02c3ede1
push id35400
push usercsabou@mozilla.com
push dateSat, 19 Jan 2019 09:59:33 +0000
treeherdermozilla-central@f90bab5af97e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1503826
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503826 - Remove the treerows binding, r=bgrins
toolkit/content/widgets/tree.xml
toolkit/content/xul.css
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -13,19 +13,26 @@
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="tree" extends="chrome://global/content/bindings/general.xml#basecontrol">
     <content hidevscroll="true" hidehscroll="true" clickthrough="never">
       <children includes="treecols"/>
       <xul:stack class="tree-stack" flex="1">
-        <xul:treerows class="tree-rows" flex="1" xbl:inherits="hidevscroll">
-          <children/>
-        </xul:treerows>
+        <xul:hbox class="tree-rows" flex="1">
+          <xul:hbox flex="1" class="tree-bodybox">
+            <children/>
+          </xul:hbox>
+          <xul:scrollbar height="0" minwidth="0" minheight="0" orient="vertical" xbl:inherits="collapsed=hidevscroll" style="position:relative; z-index:2147483647;"
+            oncontextmenu="event.stopPropagation(); event.preventDefault();"
+            onclick="event.stopPropagation(); event.preventDefault();"
+            ondblclick="event.stopPropagation();"
+            oncommand="event.stopPropagation();"/>
+          </xul:hbox>
         <xul:textbox anonid="input" class="tree-input" left="0" top="0" hidden="true"/>
       </xul:stack>
       <xul:hbox xbl:inherits="collapsed=hidehscroll">
         <xul:scrollbar orient="horizontal" flex="1" increment="16" style="position:relative; z-index:2147483647;"
           oncontextmenu="event.stopPropagation(); event.preventDefault();"
           onclick="event.stopPropagation(); event.preventDefault();"
           ondblclick="event.stopPropagation();"
           oncommand="event.stopPropagation();"/>
@@ -596,16 +603,42 @@
           }
 
           return this.changeOpenState(this.currentIndex);
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
+      <handler event="underflow">
+        <![CDATA[
+          // Scrollport event orientation
+          // 0: vertical
+          // 1: horizontal
+          // 2: both (not used)
+          if (event.target.tagName != "treechildren")
+            return;
+          if (event.detail == 1)
+            this.setAttribute("hidehscroll", "true");
+          else if (event.detail == 0)
+            this.setAttribute("hidevscroll", "true");
+          event.stopPropagation();
+        ]]>
+      </handler>
+      <handler event="overflow">
+        <![CDATA[
+          if (event.target.tagName != "treechildren")
+            return;
+          if (event.detail == 1)
+            this.removeAttribute("hidehscroll");
+          else if (event.detail == 0)
+            this.removeAttribute("hidevscroll");
+          event.stopPropagation();
+        ]]>
+      </handler>
       <handler event="touchstart">
         <![CDATA[
           function isScrollbarElement(target) {
             return (target.localName == "thumb" || target.localName == "slider")
                 && target.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
           }
           if (event.touches.length > 1 || isScrollbarElement(event.touches[0].target)) {
             // Multiple touch points detected, abort. In particular this aborts
@@ -867,48 +900,9 @@
            }
            event.preventDefault();
          }
          ]]>
       </handler>
     </handlers>
   </binding>
 
-  <binding id="treerows" extends="chrome://global/content/bindings/general.xml#basecontrol">
-    <content>
-      <xul:hbox flex="1" class="tree-bodybox">
-        <children/>
-      </xul:hbox>
-      <xul:scrollbar height="0" minwidth="0" minheight="0" orient="vertical" xbl:inherits="collapsed=hidevscroll" style="position:relative; z-index:2147483647;"
-        oncontextmenu="event.stopPropagation(); event.preventDefault();"
-        onclick="event.stopPropagation(); event.preventDefault();"
-        ondblclick="event.stopPropagation();"
-        oncommand="event.stopPropagation();"/>
-    </content>
-    <handlers>
-      <handler event="underflow">
-        <![CDATA[
-          // Scrollport event orientation
-          // 0: vertical
-          // 1: horizontal
-          // 2: both (not used)
-          var tree = document.getBindingParent(this);
-          if (event.detail == 1)
-            tree.setAttribute("hidehscroll", "true");
-          else if (event.detail == 0)
-            tree.setAttribute("hidevscroll", "true");
-          event.stopPropagation();
-        ]]>
-      </handler>
-      <handler event="overflow">
-        <![CDATA[
-          var tree = document.getBindingParent(this);
-          if (event.detail == 1)
-            tree.removeAttribute("hidehscroll");
-          else if (event.detail == 0)
-            tree.removeAttribute("hidevscroll");
-          event.stopPropagation();
-        ]]>
-      </handler>
-    </handlers>
-  </binding>
-
 </bindings>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -439,20 +439,16 @@ treecolpicker {
 }
 
 tree > treechildren {
   display: -moz-box;
   -moz-user-select: none;
   -moz-box-flex: 1;
 }
 
-treerows {
-  -moz-binding: url("chrome://global/content/bindings/tree.xml#treerows");
-}
-
 tree {
   -moz-box-orient: vertical;
   min-width: 0px;
   min-height: 0px;
   width: 10px;
   height: 10px;
 }