VoiceOver announces aria-keyshortcuts Meta/Alt literally instead of Command/Option on macOS
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: peta.duda, Assigned: morgan)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 external file)
|
1.31 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
Steps to reproduce:
- Save the following as an HTML file:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>aria-keyshortcuts modifier test</title>
</head>
<body>
<button aria-keyshortcuts="Meta+Shift+M">Meta shortcut</button>
<button aria-keyshortcuts="Alt+Shift+M">Alt shortcut</button>
</body>
</html>
- Open the file in Firefox on macOS.
- Enable VoiceOver.
- Navigate to each button.
- Have VoiceOver announce the accessibility information, including the keyboard shortcut.
The page uses the valid, platform-neutral modifier names required by aria-keyshortcuts. The WAI-ARIA syntax uses Meta for the Command key and Alt for the Option key on Apple computers.
Actual results:
VoiceOver announces the modifier names literally:
Meta+Shift+Mis announced as “Meta Shift M”.Alt+Shift+Mis announced as “Alt Shift M”.
This is confusing for macOS users because Apple keyboards have keys labelled Command and Option, not Meta and Alt.
Firefox appears to expose the original aria-keyshortcuts string through the macOS AXKeyShortcutsValue accessibility attribute without translating the platform-neutral modifier names.
Firefox added macOS support for aria-keyshortcuts in bug 1467382:
https://bugzilla.mozilla.org/show_bug.cgi?id=1467382
The current Firefox implementation returns the original ARIA value:
https://searchfox.org/firefox-main/source/accessible/mac/mozAccessible.mm#981
Equivalent reports:
- Chromium: https://issues.chromium.org/issues/556516042
- WebKit: https://bugs.webkit.org/show_bug.cgi?id=323089
Expected results:
On macOS, Firefox should expose the shortcuts to the accessibility API using the terminology printed on Apple keyboards:
Meta+Shift+Mshould be exposed and announced as “Command Shift M”.Alt+Shift+Mshould be exposed and announced as “Option Shift M”.
The underlying DOM attribute should remain standards-compliant and platform-neutral. Web authors should continue using Meta and Alt in aria-keyshortcuts; Firefox's macOS accessibility bridge should translate exact modifier tokens when producing AXKeyShortcutsValue.
WebKit fixed the same issue by translating Meta to Command and Alt to Option, while leaving other tokens unchanged and preserving malformed values:
https://github.com/WebKit/WebKit/commit/4588e2f827d5f26549d89869f9865030fc3f660f
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 month ago
|
||
Thanks for reporting. This seems like either a spec issue or a VoiceOver issue. The spec doesn't say anything about translating key names in aria-keyshortcuts, which is why Firefox and Chromium (and previously even WebKit) got this wrong.
Thanks, James. That makes sense, and I agree the current spec doesn't require translation.
Two updates:
-
WebKit has now fixed this in the macOS accessibility bridge. It translates the exact tokens Meta -> Command and Alt -> Option in AXKeyShortcutsValue, leaves other tokens unchanged, and preserves malformed values: https://github.com/WebKit/WebKit/commit/4588e2f827d5f26549d89869f9865030fc3f660f (WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=323089)
-
I filed a Core-AAM issue asking for the macOS mapping to be defined, so implementations don't have to diverge: https://github.com/w3c/core-aam/issues/272
Without a change, VoiceOver users on Firefox hear "Meta Shift M" and "Alt Shift M" rather than "Command Shift M" and "Option Shift M", which doesn't match the keys on Apple keyboards.
Since this only changes the macOS bridge output and leaves the DOM attribute untouched, it seems low risk to align with WebKit now. If you'd rather wait for the spec discussion, I'm happy to keep this bug open and update it once there's a resolution.
Comment 4•1 month ago
|
||
(In reply to Petr Duda from comment #3)
Since this only changes the macOS bridge output and leaves the DOM attribute untouched, it seems low risk to align with WebKit now.
I agree, though I wasn't clear about that in my previous comment; sorry. We won't necessarily wait for the Core AAM update - I think it's reasonable for us to make this change before then - but I also can't give you a timeline on when we'll get to this bug.
Thank you for filing the Core AAM issue.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 5•1 month ago
|
||
Without this patch, keyshortcuts that use alt and meta are read literally
on macOS. With this patch, those keys are mapped to option and
command respectively. The aria-keyshortcuts property is still
exposed via AXKeyShortcutsValue and everything else about exposure,
including malformed values passed via this property, is unchanged.
This matches WebKit's behaviour. I've used their test cases below, too.
Comment 7•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•