You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
aria-invalid:spelling/grammar is not mapped correctly on macOS #254
I'm currently working on AX support for CSS Custom Highlights on chromium and saw that there's no support for grammar errors on macOS (or at least I couldn't manage to make VoiceOver announce grammar errors in any app, please correct me if this is not the case).
In the codebase there's no mapping for aria-invalid from AXInvalid to 'spelling' or 'grammar' like in other platforms (UIA, IA2 and Linux correctly use those). Spelling errors are mapped to text attribute NSAccessibilityMarkedMisspelledTextAttribute, while grammar errors are not supported at all (I haven't found a similar text attribute to the spelling one either).
I tried modifying the code in chromium to map those to AXInvalid:'spelling' or 'grammar' but it's not recognized by VoiceOver.
Probably we should update CoreAAM docs? Or I'm not sure if this is something that's pending on macOS?
Thanks for filing, @ffiori! I just did some more testing with Safari and noticed the following:
aria-invalid=grammar/spelling/true is announced when aria-invalid is set directly on the textbox element (and not the text children). Example: <div contenteditable aria-invalid="grammar">This are a dog</div>
aria-invalid=grammar/spelling/true is not announced when set on a text child of a textbox element. Example: <div contenteditable>This <span aria-invalid="grammar">are</span> a dog</div>
This changes my initial opinion that the Core-AAM spec for aria-invalid on AX API is incorrect. It sounds accurate to me.
I also found this interesting:
This state is being deprecated as a global state in ARIA 1.2. In future versions it will only be allowed on roles where it is specifically supported. link
As of ARIA 1.2, the supported roles are application, checkbox, combobox, gridcell, listbox, radiogroup, slider, spinbutton, textbox, and tree. Note that textual roles (like heading, for example) aren't included in the list, so it feels like this behavior is by design.
However, it seems like Core-AAM is lacking a mapping to NSAccessibilityMarkedMisspelledTextAttribute (as you called out). Both Safari and Chromium implement it, and it should be reflected in the standards.
@cookiecrook, can you/someone on the VoiceOver team confirm the following:
The AX API currently doesn't have an equivalent "NSAccessibilityMarkedGrammarTextAttribute", but to be consistent with the spelling errors, maybe it should?
Safari currently doesn't support accessible CSS highlights.
Activity
benbeaudry commentedon Oct 28, 2025
Thanks for filing, @ffiori! I just did some more testing with Safari and noticed the following:
aria-invalidis set directly on thetextboxelement (and not thetextchildren). Example:<div contenteditable aria-invalid="grammar">This are a dog</div>textchild of atextboxelement. Example:<div contenteditable>This <span aria-invalid="grammar">are</span> a dog</div>This changes my initial opinion that the Core-AAM spec for
aria-invalidon AX API is incorrect. It sounds accurate to me.I also found this interesting:
As of ARIA 1.2, the supported roles are application, checkbox, combobox, gridcell, listbox, radiogroup, slider, spinbutton, textbox, and tree. Note that textual roles (like heading, for example) aren't included in the list, so it feels like this behavior is by design.
However, it seems like Core-AAM is lacking a mapping to NSAccessibilityMarkedMisspelledTextAttribute (as you called out). Both Safari and Chromium implement it, and it should be reflected in the standards.
@cookiecrook, can you/someone on the VoiceOver team confirm the following: