Bug 1542317 - restore part of the attachmentlist bindings overzealously removed in rev 66cc9a7a0aaa of bug 1526811. r+a=me
authorJorg K <jorgk@jorgk.com>
Fri, 05 Apr 2019 23:27:23 +0200
changeset 33987 a3b2ff50ea269c3c9bbaba2fea8711bd34c869d4
parent 33986 e0ec15fa6c0626752a5ff03d6fdf2424f7d753fc
child 33988 4a2cd2ce46b9e8c040d1460dfa784eed4c7ebaa8
push id2400
push usermozilla@jorgk.com
push dateFri, 19 Apr 2019 16:50:45 +0000
treeherdercomm-beta@cc70860e0c10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1542317, 1526811
Bug 1542317 - restore part of the attachmentlist bindings overzealously removed in rev 66cc9a7a0aaa of bug 1526811. r+a=me
mail/base/content/mailWidgets.xml
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -212,17 +212,17 @@
           this.insertBefore(item, this.getItemAtIndex(index));
           return item;
         ]]></body>
       </method>
 
       <!-- Get the preferred height (the height that would allow us to fit
            everything without scrollbars) of the attachmentlist's boxObject. -->
       <property name="preferredHeight" readonly="true"
-                onget="return this.scrollHeight - this.clientHeight + this.boxObject.height;"/>
+                onget="return this.scrollbox.scrollHeight - this.scrollbox.clientHeight + this.boxObject.height;"/>
 
       <!-- Find the attachmentitem node for the specified nsIMsgAttachment. -->
       <method name="findItemForAttachment">
         <parameter name="aAttachment"/>
         <body><![CDATA[
           for (let i = 0; i < this.itemCount; i++) {
             let item = this.getItemAtIndex(i);
             if (item.attachment == aAttachment)
@@ -234,16 +234,21 @@
 
       <!-- ///////////////// private members ///////////////// -->
 
       <property name="_childNodes" readonly="true">
         <getter><![CDATA[
           return this.querySelectorAll("richlistitem.attachmentItem");
         ]]></getter>
       </property>
+      <property name="scrollbox" readonly="true">
+        <getter><![CDATA[
+          return document.getAnonymousElementByAttribute(this, "anonid", "scrollbox");
+        ]]></getter>
+      </property>
 
       <method name="_fireOnSelect">
         <body><![CDATA[
           if (!this._suppressOnSelect && !this.suppressOnSelect) {
             this.dispatchEvent(new Event("select",
                                          { bubbles: false, cancelable: true }));
           }
         ]]></body>
@@ -313,16 +318,23 @@
       ]]></handler>
       <!-- make sure we keep the focus... -->
       <handler event="mousedown" button="0"
                action="if (document.commandDispatcher.focusedElement != this) this.focus();"/>
     </handlers>
   </binding>
 
   <binding id="attachmentlist-horizontal" extends="chrome://messenger/content/mailWidgets.xml#attachmentlist-base">
+    <content>
+      <xul:scrollbox flex="1" anonid="scrollbox" style="overflow: auto;">
+        <xul:hbox flex="1" class="attachmentlist-wrapper">
+          <children includes="richlistitem"/>
+        </xul:hbox>
+      </xul:scrollbox>
+    </content>
     <implementation>
       <method name="setOptimumWidth">
         <body><![CDATA[
           if (this._childNodes.length == 0)
             return;
 
           let width = 0;
           let border = this._childNodes[0].boxObject.width -