Skip to content

Commit

Permalink
Bug 1538367 - Fix quantumbar popup's vertical position on Mac. r=mak
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D25753

--HG--
extra : moz-landing-system : lando
  • Loading branch information
daogottwald committed Apr 2, 2019
1 parent e351fb0 commit 0baba2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 6 additions & 10 deletions browser/components/urlbar/UrlbarView.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,6 @@ class UrlbarView {
this.panel.removeAttribute("hidden");
this.panel.removeAttribute("actionoverride");

this._alignPanel();

this.panel.openPopup(this.input.textbox, "after_start");
}

_alignPanel() {
// Make the panel span the width of the window.
let documentRect =
this._getBoundsWithoutFlushing(this.document.documentElement);
Expand Down Expand Up @@ -394,10 +388,12 @@ class UrlbarView {
// Align the panel with the input's parent toolbar.
let toolbarRect =
this._getBoundsWithoutFlushing(this.input.textbox.closest("toolbar"));
this.panel.style.marginInlineStart = this.window.RTL_UI ?
inputRect.right - documentRect.right + "px" :
documentRect.left - inputRect.left + "px";
this.panel.style.marginTop = inputRect.top - toolbarRect.top + "px";
let offsetX = Math.round(this.window.RTL_UI ?
inputRect.right - documentRect.right :
documentRect.left - inputRect.left);
let offsetY = Math.round(inputRect.top - toolbarRect.top);

this.panel.openPopup(this.input.textbox, "after_start", offsetX, offsetY);
}

_createRow() {
Expand Down
3 changes: 2 additions & 1 deletion browser/themes/osx/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ html|input.urlbar-input {
* bottom of the nav bar, OSX calculates the panel position with an missing
* 1px - https://bugzilla.mozilla.org/show_bug.cgi?id=1406353
*/
#PopupAutoCompleteRichResult {
#PopupAutoCompleteRichResult,
#urlbar-results {
margin-top: 1px;
}

Expand Down

0 comments on commit 0baba2a

Please sign in to comment.