Closed Bug 2074048 Opened 2 months ago Closed 1 month ago

VoiceOver announces aria-keyshortcuts Meta/Alt literally instead of Command/Option on macOS

Categories

(Core :: Disability Access APIs, defect)

Firefox 156
Desktop
macOS
defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: peta.duda, Assigned: morgan)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 1 external file)

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:

  1. 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>
  1. Open the file in Firefox on macOS.
  2. Enable VoiceOver.
  3. Navigate to each button.
  4. 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+M is announced as “Meta Shift M”.
  • Alt+Shift+M is 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:

Expected results:

On macOS, Firefox should expose the shortcuts to the accessibility API using the terminology printed on Apple keyboards:

  • Meta+Shift+M should be exposed and announced as “Command Shift M”.
  • Alt+Shift+M should 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

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.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core

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.

Blocks: aria
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

Thanks, James. That makes sense, and I agree the current spec doesn't require translation.

Two updates:

  1. 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)

  2. 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.

Flags: needinfo?(jteh)

(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.

Flags: needinfo?(jteh)
OS: Unspecified → macOS
Hardware: Unspecified → Desktop
Assignee: nobody → mreschenberg

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.

Pushed by mreschenberg@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/633f10778087 https://hg.mozilla.org/integration/autoland/rev/39378bab4ba9 Expose aria-keyshortcuts Meta and Alt as Command and Option on macOS r=accessibility-platform-reviewers,eeejay
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
Blocks: 2083200
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: