Bug 1584336 - Re-add the width attribute to the searchbar. r=dao a=lizzard
authorHarry Twyford <htwyford@mozilla.com>
Tue, 01 Oct 2019 08:27:56 +0000
changeset 555458 c0a9eaf7c5a5f67fec2967f9a15ee57a03ecb118
parent 555457 074e38c710b9f00cf41056d58e58e7c84630444f
child 555459 37355d143d67b0d9353cc94b7da33d411de6a3de
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, lizzard
bugs1584336
milestone70.0
Bug 1584336 - Re-add the width attribute to the searchbar. r=dao a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D47624
browser/components/search/content/searchbar.js
--- a/browser/components/search/content/searchbar.js
+++ b/browser/components/search/content/searchbar.js
@@ -783,17 +783,22 @@
 
           document.popupNode = null;
 
           let { width } = this.getBoundingClientRect();
           // Ensure the panel is wide enough to fit at least 3 engines.
           if (this.oneOffButtons) {
             width = Math.max(width, this.oneOffButtons.buttonWidth * 3);
           }
+
+          // The CSS minWidth is necessary for the searchbar to be the correct
+          // width in the overflow menu. The width attribute is necessary for
+          // _invalidate().
           popup.style.minWidth = width + "px";
+          popup.setAttribute("width", width);
 
           popup._invalidate();
 
           popup.openPopup(this, "after_start");
         }
       };
 
       this.textbox.openSearch = () => {