Bug 1921951 - Fixed linter errors. r=tabbrowser-reviewers,dao

Differential Revision: https://phabricator.services.mozilla.com/D233208
This commit is contained in:
Mauro B
2025-01-04 12:48:45 +00:00
parent dea2dbc861
commit 35bae9ed07

View File

@@ -2773,7 +2773,7 @@
left: selectedTab.left,
right: selectedTab.right,
top: selectedTab.top,
bottom: selectedTab.bottom
bottom: selectedTab.bottom,
};
}
return [
@@ -2796,13 +2796,11 @@
delete this._lastTabToScrollIntoView;
// Is the new tab already completely visible?
if (
this.verticalMode ? (
scrollRect.top <= tabRect.top &&
tabRect.bottom <= scrollRect.bottom
) : (
scrollRect.left <= tabRect.left &&
tabRect.right <= scrollRect.right
)
this.verticalMode
? scrollRect.top <= tabRect.top &&
tabRect.bottom <= scrollRect.bottom
: scrollRect.left <= tabRect.left &&
tabRect.right <= scrollRect.right
) {
return;
}
@@ -2810,32 +2808,29 @@
if (this.arrowScrollbox.smoothScroll) {
// Can we make both the new tab and the selected tab completely visible?
if (
!selectedRect ||
this.verticalMode ? (
Math.max(
tabRect.bottom - selectedRect.top,
selectedRect.bottom - tabRect.top
) <= scrollRect.height
) : (
Math.max(
tabRect.right - selectedRect.left,
selectedRect.right - tabRect.left
) <= scrollRect.width
)
!selectedRect || this.verticalMode
? Math.max(
tabRect.bottom - selectedRect.top,
selectedRect.bottom - tabRect.top
) <= scrollRect.height
: Math.max(
tabRect.right - selectedRect.left,
selectedRect.right - tabRect.left
) <= scrollRect.width
) {
this.arrowScrollbox.ensureElementIsVisible(tabToScrollIntoView);
return;
}
this.arrowScrollbox.scrollByPixels(
this.verticalMode ? (
tabRect.top - selectedRect.top
) : (
this.#rtlMode
? selectedRect.right - scrollRect.right
: selectedRect.left - scrollRect.left
)
);
let scrollPixels;
if (this.verticalMode) {
scrollPixels = tabRect.top - selectedRect.top;
} else if (this.#rtlMode) {
scrollPixels = selectedRect.right - scrollRect.right;
} else {
scrollPixels = selectedRect.left - scrollRect.left;
}
this.arrowScrollbox.scrollByPixels(scrollPixels);
}
if (!this._animateElement.hasAttribute("highlight")) {