Bug 1569705 - Stop unnecessarily setting left/right margins on searchbar autocomplete popup. r=mak
authorTim Nguyen <ntim.bugs@gmail.com>
Tue, 30 Jul 2019 14:24:20 +0000
changeset 485316 c3e3ed30085e42bc6b9c0138258a9435137fd6b2
parent 485315 99003d5e05c88cdefa1e8b7b0c99051c78fc6d01
child 485317 5ad0fb1caddddb365936dc8e89ca85bba57c886f
push id36364
push userdvarga@mozilla.com
push dateTue, 30 Jul 2019 21:50:30 +0000
treeherdermozilla-central@e259d43073bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1569705
milestone70.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 1569705 - Stop unnecessarily setting left/right margins on searchbar autocomplete popup. r=mak 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");