Bug 1908431 - add basic support for tab groups in overflow menu. r=dao,fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,bolsson

Differential Revision: https://phabricator.services.mozilla.com/D232389
This commit is contained in:
DJ
2024-12-19 12:04:19 +00:00
parent b91e94e3b6
commit a807e8e024
11 changed files with 470 additions and 1 deletions

View File

@@ -138,6 +138,15 @@
this.#updateLabelAriaAttributes();
}
// alias for label
get name() {
return this.label;
}
set name(newName) {
this.label = newName;
}
get collapsed() {
return this.hasAttribute("collapsed");
}
@@ -224,6 +233,19 @@
on_TabSelect() {
this.collapsed = false;
}
/**
* If one of this group's tabs is the selected tab, this will do nothing.
* Otherwise, it will expand the group if collapsed, and select the first
* tab in its list.
*/
select() {
this.collapsed = false;
if (gBrowser.selectedTab.group == this) {
return;
}
gBrowser.selectedTab = this.tabs[0];
}
}
customElements.define("tab-group", MozTabbrowserTabGroup);