Bug 230611

Summary: AX: aria-errormessage should not be exposed when aria-invalid is false
Product: WebKit Reporter: Joanmarie Diggs <jdiggs>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Joanmarie Diggs 2021-09-22 05:05:04 PDT
Steps to reproduce:
1. Load: data:text/html, <div role='group' id='test' aria-errormessage='error' aria-invalid='false'>content</div><div id='error'>hello world</div>
2. Examine the accessible relationships for ATK using a platform accessibility inspector (e.g. Accerciser)

Expected results: There would be no error-for/error-message relationships between the two divs
Actual results: There are error-for/error-message relationships between the two divs.

According to https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage:

> User agents MUST NOT expose aria-errormessage for an object with an aria-invalid value of false.

I think this issue also applies to macOS and iOS. However, I was not able to confirm it based on the Core-AAM's stated mappings* for aria-errormessage for macOS, however this test has aria-invalid set to false and still indicates there are error elements: https://trac.webkit.org/browser/webkit/trunk/LayoutTests/accessibility/mac/aria-errormessage.html

*The Core-AAM says the following for aria-errormessage:

> AX API	Property: AXValidationError: textual content of the referenced element

But I don't see that in Accessibility Inspector when aria-invalid set to true.
Comment 1 Radar WebKit Bug Importer 2021-09-22 05:05:18 PDT
<rdar://problem/83393652>
Comment 2 Tyler Wilcock 2023-02-19 01:32:54 PST
Created attachment 465072 [details]
Patch
Comment 3 Tyler Wilcock 2023-02-19 02:06:11 PST
Created attachment 465073 [details]
Patch
Comment 4 Tyler Wilcock 2023-02-19 11:55:16 PST
Created attachment 465076 [details]
Patch
Comment 5 Tyler Wilcock 2023-02-19 12:17:12 PST
Created attachment 465077 [details]
Patch
Comment 6 EWS 2023-02-20 10:06:11 PST
Committed 260545@main (19ae041e1fa8): <https://commits.webkit.org/260545@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 465077 [details].