Bug 1908416: gBrowser.visibleTabs handles tab groups r=dao,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D218796
This commit is contained in:
Jeremy Swinarton
2024-08-08 16:23:24 +00:00
parent cbd3abf199
commit 0d521d1f2b
3 changed files with 38 additions and 1 deletions

View File

@@ -25,6 +25,8 @@
this.addEventListener("TabUnpinned", this);
this.addEventListener("TabHoverStart", this);
this.addEventListener("TabHoverEnd", this);
this.addEventListener("TabGroupExpand", this);
this.addEventListener("TabGroupCollapse", this);
this.addEventListener("transitionend", this);
this.addEventListener("dblclick", this);
this.addEventListener("click", this);
@@ -215,6 +217,14 @@
this._previewPanel?.deactivate(event.target);
}
on_TabGroupExpand() {
this._invalidateCachedVisibleTabs();
}
on_TabGroupCollapse() {
this._invalidateCachedVisibleTabs();
}
on_transitionend(event) {
if (event.propertyName != "max-width") {
return;
@@ -1163,7 +1173,7 @@
if (!this._visibleTabs) {
this._visibleTabs = Array.prototype.filter.call(
this.allTabs,
tab => !tab.hidden && !tab.closing
tab => !tab.hidden && !tab.closing && !tab.group?.collapsed
);
}
return this._visibleTabs;