From 24c8d32c36d5be6338b792d7c8dfbbb736159b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Wed, 28 Aug 2019 13:28:46 +0000 Subject: [PATCH] Bug 1575645 - Fix Megabar vertical centering. r=harry Differential Revision: https://phabricator.services.mozilla.com/D42945 --HG-- extra : moz-landing-system : lando --- browser/components/urlbar/UrlbarInput.jsm | 1 + browser/themes/shared/urlbar-searchbar.inc.css | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/browser/components/urlbar/UrlbarInput.jsm b/browser/components/urlbar/UrlbarInput.jsm index 273911930571..5108834ab906 100644 --- a/browser/components/urlbar/UrlbarInput.jsm +++ b/browser/components/urlbar/UrlbarInput.jsm @@ -866,6 +866,7 @@ class UrlbarInput { } this.textbox.style.setProperty("--urlbar-width", px(inputRect.width)); + this.textbox.style.setProperty("--urlbar-height", px(inputRect.height)); let toolbarHeight = getBoundsWithoutFlushing( this.textbox.closest("toolbar") diff --git a/browser/themes/shared/urlbar-searchbar.inc.css b/browser/themes/shared/urlbar-searchbar.inc.css index 05318ffbbd79..1457da959729 100644 --- a/browser/themes/shared/urlbar-searchbar.inc.css +++ b/browser/themes/shared/urlbar-searchbar.inc.css @@ -92,18 +92,15 @@ margin-top: -@urlbarBreakoutVerticalExtend@; margin-inline-start: -@urlbarBreakoutHorizontalExtend@; width: calc(var(--urlbar-width) + 2 * @urlbarBreakoutHorizontalExtend@); - min-height: calc(var(--urlbar-toolbar-height) + 2 * @urlbarBreakoutVerticalExtend@); - padding: calc(3px + @urlbarBreakoutVerticalExtend@) 0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); } -#urlbar[breakout][open="true"] { - padding-bottom: 0; -} - #urlbar[breakout] > #urlbar-input-container { - padding-inline: @urlbarBreakoutHorizontalExtend@; + box-sizing: padding-box; + height: calc(var(--urlbar-toolbar-height) + 2 * @urlbarBreakoutVerticalExtend@ - 2px /* urlbar border */); width: 100%; + padding-block: calc(@urlbarBreakoutVerticalExtend@ + (var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2); + padding-inline: @urlbarBreakoutHorizontalExtend@; } #urlbar:not(.hidden-focus):-moz-lwtheme[focused="true"],