Closed Bug 1543561 Opened 6 months ago Closed 6 months ago

Non-descendant node targeted by aria-activedescendant doesn't get focusable state

Categories

(Core :: Disability Access APIs, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

Sometimes, we use aria-activedescendant targeting something which isn't actually a descendant. This is technically a spec violation, but it's a useful hack which makes certain things much easier. For example, we use this for "fake focus" for multi select browser tabs and Quantumbar autocomplete suggestions.

Unfortunately, our code for making potential active descendants focusable only deals with real descendants. That means that when we use this hack, the accessible gets the focused state but not the focusable state, which doesn't make sense.

Aside from potentially confusing a11y clients, this is causing test failures in the URL bar a11y tests with Quantumbar enabled.

Distilled test case:
data:text/html,<input aria-activedescendant="foo"><div role="listbox"><div role="option" id="foo">foo</div></div>

With the input focused, the option gets a11y focus. It gets the focused state, but not the focusable state.

Sometimes, we use aria-activedescendant targeting something which isn't actually a descendant.
This is technically a spec violation, but it's a useful hack which makes certain things much easier.
For example, we use this for "fake focus" for multi select browser tabs and Quantumbar autocomplete suggestions.

This already worked previously; the accessible received a focus event and the focused state.
However, it did not receive the focusable state.
This is because the code which applies the focusable state for potential active descendants only works for descendants.

It really doesn't make sense for something to be focused when it isn't focusable.
In fact, this is an a11y test failure when it occurs.
So, if the active item has the focused state, ensure we expose the focusable state too.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50c1ff58c682
Expose the focusable state on a node focused by aria-activedescendant, even if that node isn't a descendant. r=eeejay
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.