Bug 250124

Summary: AX: Wrong role displayed for input in Safari inspector
Product: WebKit Reporter: Giacomo Petri <giacomo.petri>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Minor CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
Attachments:
Description Flags
Screenshot displaying Role: No matching ARIA role for input type="text"
none
Patch
none
Patch
none
Patch
none
Patch none

Description Giacomo Petri 2023-01-05 02:23:56 PST
Created attachment 464344 [details]
Screenshot displaying Role: No matching ARIA role for input type="text"

Even though, using VoiceOver + Safari the input type="text" is properly announced as "$label, edit text" which properly convey the element semantic, from the inspector the role provided within the Accessibility section is "No matching ARIA role", which is not true. 
Even forcing the role="textbox" the role is still "No matching ARIA role".

This contrasts with both the WAI-ARIA (https://www.w3.org/TR/wai-aria-1.2/#textbox) and HTML Accessibility API Mappings (https://www.w3.org/TR/html-aam-1.0/#el-input-text).

Similarly, this happens for other input types:
* email (Role: "No matching aria role" but it should be "textbox", as per html-aam-1.0 - https://www.w3.org/TR/html-aam-1.0/#el-input-email)
* number (Role: "No matching aria role" but it should be "textbox", as per html-aam-1.0 - https://www.w3.org/TR/html-aam-1.0/#el-input-number)
* tel (Role: "No matching aria role" but it should be "textbox", as per html-aam-1.0 - https://www.w3.org/TR/html-aam-1.0/#el-input-tel)
* url (Role: "No matching aria role" but it should be "textbox", as per html-aam-1.0 - https://www.w3.org/TR/html-aam-1.0/#el-input-url)

Differently, it's behaving as expected for input types like:
* checkbox
* search
* button/reset/submit
* image
* range
* color (Role: "No matching aria role" but it's correct, as per html-aam-1.0 - https://www.w3.org/TR/html-aam-1.0/#el-input-color)
* etc.
Comment 1 Radar WebKit Bug Importer 2023-01-05 02:24:08 PST
<rdar://problem/103907008>
Comment 2 Tyler Wilcock 2023-02-26 13:11:14 PST
Created attachment 465187 [details]
Patch
Comment 3 Tyler Wilcock 2023-02-26 17:26:25 PST
Created attachment 465190 [details]
Patch
Comment 4 Tyler Wilcock 2023-02-26 17:52:46 PST
Created attachment 465191 [details]
Patch
Comment 5 Tyler Wilcock 2023-02-26 18:56:52 PST
Created attachment 465192 [details]
Patch
Comment 6 EWS 2023-02-27 00:49:13 PST
Committed 260868@main (5cd01f201aba): <https://commits.webkit.org/260868@main>

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