Bug 1821657 - Remove BrowserUIUtils.setToolbarButtonHeightProperty and related code. r=Gijs,desktop-theme-reviewers,dao

I don't see any visible issue on the reload / stop buttons without this.

Differential Revision: https://phabricator.services.mozilla.com/D172238
This commit is contained in:
Emilio Cobos Álvarez 2023-03-13 11:56:55 +00:00
Родитель ee72efd1e9
Коммит 566f0c7a63
5 изменённых файлов: 0 добавлений и 59 удалений

Просмотреть файл

@ -5796,7 +5796,6 @@ var CombinedStopReload = {
this._cancelTransition();
if (shouldAnimate) {
BrowserUIUtils.setToolbarButtonHeightProperty(this.stopReloadContainer);
this.stopReloadContainer.setAttribute("animate", "true");
} else {
this.stopReloadContainer.removeAttribute("animate");
@ -5819,7 +5818,6 @@ var CombinedStopReload = {
this.stopReloadContainer.closest("#nav-bar-customization-target");
if (shouldAnimate) {
BrowserUIUtils.setToolbarButtonHeightProperty(this.stopReloadContainer);
this.stopReloadContainer.setAttribute("animate", "true");
} else {
this.stopReloadContainer.removeAttribute("animate");

Просмотреть файл

@ -8,11 +8,6 @@ var EXPORTED_SYMBOLS = ["Pocket"];
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"BrowserUIUtils",
"resource:///modules/BrowserUIUtils.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"CustomizableUI",
@ -28,13 +23,6 @@ var Pocket = {
},
_initPanelView(window) {
let document = window.document;
let libraryButton = document.getElementById("library-button");
if (libraryButton) {
lazy.BrowserUIUtils.setToolbarButtonHeightProperty(libraryButton);
}
let urlToSave = Pocket._urlToSave;
let titleToSave = Pocket._titleToSave;
Pocket._urlToSave = null;

Просмотреть файл

@ -69,42 +69,6 @@ var BrowserUIUtils = {
return contentPrincipal.isSystemPrincipal;
},
/**
* Sets the --toolbarbutton-button-height CSS property on the closest
* toolbar to the provided element. Useful if you need to vertically
* center a position:absolute element within a toolbar that uses
* -moz-pack-align:stretch, and thus a height which is dependant on
* the font-size.
*
* @param element An element within the toolbar whose height is desired.
*/
async setToolbarButtonHeightProperty(element) {
let window = element.ownerGlobal;
let dwu = window.windowUtils;
let toolbarItem = element;
let urlBarContainer = element.closest("#urlbar-container");
if (urlBarContainer) {
// The stop-reload-button, which is contained in #urlbar-container,
// needs to use #urlbar-container to calculate the bounds.
toolbarItem = urlBarContainer;
}
if (!toolbarItem) {
return;
}
let bounds = dwu.getBoundsWithoutFlushing(toolbarItem);
if (!bounds.height) {
await window.promiseDocumentFlushed(() => {
bounds = dwu.getBoundsWithoutFlushing(toolbarItem);
});
}
if (bounds.height) {
toolbarItem.style.setProperty(
"--toolbarbutton-height",
bounds.height + "px"
);
}
},
/**
* Generate a document fragment for a localized string that has DOM
* node replacements. This avoids using getFormattedString followed

Просмотреть файл

@ -47,10 +47,6 @@ toolbar[brighttext]:-moz-lwtheme {
animation-fill-mode: forwards;
animation-iteration-count: 1;
list-style-image: none;
/* Height must be equal to height of toolbarbutton padding-box. --toolbarbutton-height
is calculated and set during runtime by BrowserUIUtils.setToolbarButtonHeightProperty()
before the animation begins. */
height: var(--toolbarbutton-height);
}
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,

Просмотреть файл

@ -15,11 +15,6 @@
--toolbarseparator-color: color-mix(in srgb, currentColor 60%, transparent);
--bookmark-block-padding: 4px;
/* This default value of --toolbarbutton-height is defined to prevent
CSS errors for an invalid variable. The value should not get used,
as a more specific value should be set when the value will be used. */
--toolbarbutton-height: 0;
}
:root[uidensity=compact] {