Open Jym77 opened 1 year ago
The lack of a role mapping for input type=password
is due to security concerns: https://github.com/w3c/aria/issues/935
Some other input types also have no ARIA role mapping, but map to various platform-specfic API roles (IA2_ROLE_DATE_EDITOR / AXTimeField / ROLE_SYSTEM_SPINBUTTON)
One way of doing this is looking at the platform-specific roles for controls with no ARIA role mapping. For input type=password
this maps to:
ROLE_SYSTEM_TEXT
The object represents selectable text that allows edits or is designated as read-only. https://learn.microsoft.com/en-us/windows/win32/winauto/object-rolesATK_ROLE_PASSWORD_TEXT
A text object uses for passwords, or other places where the text content is not shown visibly to the user. https://docs.gtk.org/atk/enum.Role.htmlAXSecureTextField
So you could use wording like the following:
This rule applies to any element that is included in the accessibility tree, and that has:
The second item only applies for elements with no explicit role and marked as 'No corresponding role' in HTML AAM but have platform specific mappings. This looks like it can be extended to other input types like input type=time
as well.
As per HTML AAM,
<input type="password">
elements have no role.This means that they are not considered by most of our "form fields" rules, among other Form field has non-empty accessible name, therefore we do not flag
<input type="password">
as missing an accessible name, while it seems that it should.I do remember us already doing some tricks around
<input type="password">
in https://github.com/act-rules/act-rules.github.io/pull/1612 It looks like we should update a few more rules for that.