Closed Bug 1994356 Opened 6 months ago Closed 6 months ago

Unable to select a tab with Narrator if it has focus and doesn't explicitly set aria-selected="false"

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [uiaFastFollow])

Attachments

(2 files)

STR:

  1. Start Narrator.
  2. Open this test case:
    data:text/html,<button>before</button><div role="tablist"><div role="tab" tabindex="0" aria-selected="true">a</div><div role="tab" tabindex="0" onclick="alert('b');">b</div></div><button>after</button>
  3. Tab to the "b" tab.
    • Expected: Narrator says "b tab item, 2 of 2" (no "selected")
    • Actual: Narrator says "b tab item, 2 of 2, selected"
  4. Press enter.
    • Expected: An alert pop-up appears saying "b".
    • Actual: Nothing happens.
  5. Now, open the same test case, but with aria-selected="false" on the "b" tab; i.e.:
    data:text/html,<button>before</button><div role="tablist"><div role="tab" tabindex="0" aria-selected="true">a</div><div role="tab" aria-selected="false" tabindex="0" onclick="alert('b');">b</div></div><button>after</button>
  6. Tab to the "b" tab.
    • Observe: Narrator says "b tab item, 2 of 2" (no "selected")
  7. Press enter.
    • Observe: An alert pop-up appears saying "b".

The underlying issue here is that Gecko exposes the selected state when it shouldn't. Even though the tab has focus and there is no explicit aria-selected attribute, there is an aria-selected on another tab, so we shouldn't expose selection implicitly. This causes a big problem for Narrator because it refuses to select a tab that is already selected.

We fixed implicit selection for list options in bug 1894437. However, that doesn't extend to tabs because we special case focused tabs. I think we should just remove that special case, which is not covered by the spec. However, we should probably keep the special case for the active tabpanel, which is vaguely covered by the spec.

Originally reported in bug 1993697 comment 2. Original test case: https://flamewolf.github.io/base-95.html

See Also: → 1993697

For now, you can work around this by explicitly setting aria-selected="false" on unselected tabs, but obviously, we should fix the bug.

Instead, for focused tabs, we should apply the same rules we use for options and treeitems.
Note that in browser_caching_states.js, I had to change one of the implicit selected state tests so that nothing in the container is explicitly selected in order to trigger implicit selection with these changed rules.
We have a test elsewhere in states/browser_test_selection.js which verifies that explicit selection takes precedence over implicit selection.

This just moves the test with no other changes.
Previously, we had tests related to the implicit selected state in two different places, which is confusing at best.
Also, any progress we can make towards organising the wild dumping ground of tests in e10s/ is a good thing.

Pushed by jteh@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/66085b85b371 https://hg.mozilla.org/integration/autoland/rev/dc987ad79e06 part 1: Don't implicitly treat a tab as selected just because it is focused. r=morgan https://github.com/mozilla-firefox/firefox/commit/983d1d4f34e4 https://hg.mozilla.org/integration/autoland/rev/44b6d3448563 part 2: Move the implicit selected state test from browser_caching_states.js to states/browser_test_selection.js. r=morgan
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
QA Whiteboard: [qa-triage-done-c147/b146]
Whiteboard: [uiaFastFollow]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: