test: Added more tests for glance, b=(no-bug), c=tests, scripts, tabs, glance, workspaces

This commit is contained in:
Mr. M
2025-05-22 16:57:27 +02:00
parent ad124c9d95
commit addc318f29
11 changed files with 197 additions and 273 deletions

View File

@@ -2766,41 +2766,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
}
makeSurePinTabIsInCorrectPosition() {
if (!this.pinnedTabsContainer) {
return 0; // until we initialize the pinned tabs container
}
const tabsInsidePinTab = Array.from(this.pinnedTabsContainer.parentElement.children).filter(
(child) => child.tagName === 'tab'
);
let changed = false;
for (const tab of tabsInsidePinTab) {
if (tab.getAttribute('zen-glance-tab') === 'true') {
continue;
}
if (tab.getAttribute('zen-essential') === 'true') {
const container = this.getCurrentEssentialsContainer();
container.appendChild(tab);
changed = true;
continue;
}
const workspaceId = tab.getAttribute('zen-workspace-id');
if (!workspaceId) {
continue;
}
const contaienr = this.workspaceElement(workspaceId).pinnedTabsContainer;
contaienr.insertBefore(tab, contaienr.lastChild);
changed = true;
}
if (changed) {
gBrowser.tabContainer._invalidateCachedTabs();
}
// Return the number of essentials INSIDE the pinned tabs container so we can correctly change their parent
return Array.from(this.pinnedTabsContainer.children).filter(
(child) => child.getAttribute('zen-essential') === 'true'
).length;
}
// Context menu management
_contextMenuId = null;