Closed Bug 1951857 Opened 5 months ago Closed 22 days ago

Tabs in a collapsed tab group remain in the accessibility tree

Categories

(Firefox :: Tabbed Browser, defect, P3)

defect
Points:
1

Tracking

()

RESOLVED FIXED
143 Branch
Accessibility Severity s3
Tracking Status
firefox143 --- fixed

People

(Reporter: Jamie, Assigned: sthompson)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: [fidefe-tabgrps-tabbrowser])

Attachments

(1 file)

STR (with the NVDA screen reader, but I'm almost certain this will be true for VoiceOver as well):

  1. Open a tab with example.com and move it into a tab group.
  2. Focus the tab bar, arrow to the button to toggle the tab group and press space to collapse it.
  3. Use the screen reader's command to move to the next object (NVDA desktop: NVDA+numpad6, NVDA laptop: NVDA+shift+rightArrow, VoiceOver: VO+rightArrow).
    • Expected: The screen reader should report the Open a new tab button.
    • Actual: The screen reader reports the Example Domain tab.

When a tab group is collapsed, it seems its <tab> elements aren't removed from the DOM and are still rendered by layout; i.e. they don't have hidden, display: none or similar. They just have a width of 0, so they aren't visible. This means they are still in the accessibility tree, which is incorrect because they shouldn't be perceivable semantically given that the tab group is collapsed.

Ideally, these should have hidden or display: none or the like. If that isn't a feasible implementation, they should get aria-hidden="true" until the tab group is expanded again.

Points: --- → 1
Priority: -- → P2
Whiteboard: [fidefe-tabgrps-tabbrowser]
Severity: -- → S3
Component: about:logins → Tabbed Browser
Priority: P2 → P1
Priority: P1 → P3

Added a visibility transition on tabs to match the transition duration that we use for the expand/collapse animation of horizontal tab groups. Added visibility: hidden on tabs in collapsed tab groups so that they are removed from the accessibility tree at the end of the collapse animation.

Assignee: nobody → sthompson
Status: NEW → ASSIGNED

Hi :Jamie, I received a question about my patch for this bug and I'm not sure how to proceed.

Add-ons are able to hide tabs https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/hide. A hidden tab will not be in the accessibility tree for the <tabs> element (i.e. the tab strip), which makes sense. It appears that a hidden tab will still be in the accessibility tree for the <tabpanels> element (i.e. the actual tab content areas). I would naively believe that the hidden tab's contents should not be present in the <tabpanels> accessibility tree for the sake of consistency, but perhaps there are good reasons to continue to have it stay present in the accessibility tree. Do you have any ideas?

My patch removes tabs in collapsed tab groups from the tab strip accessibility tree (as requested in this bug) but keeps them in the tab content areas accessibility tree. Is this sufficient, or is there an opportunity to improve things in the tab content areas accessibility tree?

Flags: needinfo?(jteh)

Great question. In most cases, your intuition would be correct: if we're going to remove a tab from the strip, we should also remove its content area. However, browser tabs are an exception to that rule. The reason is that assistive technology tools might cache information about a content document. Removing the content area would cause that information to be lost. This could cause the user to lose their position in the document when they eventually return to it, as well as having a performance impact due to needing to rebuild the cache. It would be similar to completely unloading a tab every time we hide it, which we don't do for similar reasons.

Flags: needinfo?(jteh)

Thank you so much! I'll include this context in a comment in https://searchfox.org/mozilla-central/source/accessible/tests/mochitest/tree/test_tabbrowser.xhtml so that the difference between the <tabs> and <tabpanels> accessibility trees is explained.

Pushed by sthompson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e99fb753b3c3 https://hg.mozilla.org/integration/autoland/rev/de49c0429b24 tabs in collapsed tab groups should not be in accessibility tree r=dao,desktop-theme-reviewers,tabbrowser-reviewers
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b3a7cbccaf06 https://hg.mozilla.org/integration/autoland/rev/2f969f25b799 Revert "Bug 1951857 - tabs in collapsed tab groups should not be in accessibility tree r=dao,desktop-theme-reviewers,tabbrowser-reviewers" for causing bc failures @ browser_bug1620341.js

Backed out for causing bc failures @ browser_bug1620341.js

Flags: needinfo?(sthompson)
Pushed by sthompson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f858f0326a55 https://hg.mozilla.org/integration/autoland/rev/43d6adb2df68 tabs in collapsed tab groups should not be in accessibility tree r=dao,jswinarton,desktop-theme-reviewers,tabbrowser-reviewers
Status: ASSIGNED → RESOLVED
Closed: 22 days ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
Flags: needinfo?(sthompson)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: