Skip to content

Commit

Permalink
Prepare to support multiple containers for tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 26, 2024
1 parent 7258f38 commit 50de9e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions webextensions/common/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,12 +1131,6 @@ export default class Tab {
this.states.add(state);

switch (state) {
case Constants.kTAB_STATE_ACTIVE:
if (this.element &&
this.element.parentNode)
this.element.parentNode.setAttribute('aria-activedescendant', this.element.id);
break;

case Constants.kTAB_STATE_HIGHLIGHTED:
if (this.element)
this.element.setAttribute('aria-selected', 'true');
Expand Down
5 changes: 5 additions & 0 deletions webextensions/sidebar/sidebar-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,13 @@ BackgroundConnection.onMessage.addListener(async message => {
const tab = Tab.get(lastMessage.tabId);
if (!tab)
return;
const lastActive = TabsStore.activeTabInWindow.get(lastMessage.windowId);
if (lastActive &&
lastActive.$TST.element)
lastActive.$TST.element.parentNode.removeAttribute('aria-activedescendant');
TabsStore.activeTabInWindow.set(lastMessage.windowId, tab);
TabsInternalOperation.setTabActive(tab);
tab.$TST.element.parentNode.setAttribute('aria-activedescendant', tab.$TST.element.id);
}; break;

case Constants.kCOMMAND_NOTIFY_TAB_UPDATED: {
Expand Down

0 comments on commit 50de9e6

Please sign in to comment.