Bug 1569705 - Stop unnecessarily setting left/right margins on searchbar autocomplete popup. r=mak a=RyanVM
authorTim Nguyen <ntim.bugs@gmail.com>
Tue, 30 Jul 2019 14:24:20 +0000
changeset 544853 3f26710d6f0e82e814cbb623c14a1ce7630354ac
parent 544852 86fb2666395c920b8eca15589d5b4d22670b244e
child 544854 7b2d5bd73d933c9d91fc6d87b05b975e31acc9f4
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, RyanVM
bugs1569705
milestone69.0
Bug 1569705 - Stop unnecessarily setting left/right margins on searchbar autocomplete popup. r=mak a=RyanVM This code now became obsolete and broken with the autocomplete popup being anchored to the textbox instead of the textbox inner input. Differential Revision: https://phabricator.services.mozilla.com/D39794
browser/components/search/content/autocomplete-popup.js
--- a/browser/components/search/content/autocomplete-popup.js
+++ b/browser/components/search/content/autocomplete-popup.js
@@ -14,32 +14,23 @@
     constructor() {
       super();
 
       this.addEventListener("popupshowing", event => {
         // Force the panel to have the width of the searchbar rather than
         // the width of the textfield.
         let DOMUtils = window.windowUtils;
         let textboxRect = DOMUtils.getBoundsWithoutFlushing(this.mInput);
-        let inputRect = DOMUtils.getBoundsWithoutFlushing(
-          this.mInput.inputField
-        );
 
         // Ensure the panel is wide enough to fit at least 3 engines.
         let minWidth = Math.max(
           textboxRect.width,
           this.oneOffButtons.buttonWidth * 3
         );
         this.style.minWidth = Math.round(minWidth) + "px";
-        // Alignment of the panel with the searchbar is obtained with negative
-        // margins.
-        this.style.marginLeft = textboxRect.left - inputRect.left + "px";
-        // This second margin is needed when the direction is reversed,
-        // eg. when using command+shift+X.
-        this.style.marginRight = inputRect.right - textboxRect.right + "px";
 
         // First handle deciding if we are showing the reduced version of the
         // popup containing only the preferences button. We do this if the
         // glass icon has been clicked if the text field is empty.
         let searchbar = document.getElementById("searchbar");
         if (searchbar.hasAttribute("showonlysettings")) {
           searchbar.removeAttribute("showonlysettings");
           this.setAttribute("showonlysettings", "true");