iOS - VoiceOver reads the programmatically associated label instead of the accessible name provided via the aria-label or aria-labelledby attribute
<rdar://problem/78762510>
rdar://65935211
Expected: When an input has a programmatically associated label and an aria-label attribute or aria-labelledby attribute, based on the accessible name computation the aria-label or aria-labelledby attribute should take precedence over the programmatically associated label. Actual: VoiceOver on iOS, reads the programmatically associated label instead of the accessible name provided via the aria-label or aria-labelledby attribute Applies to input types: text, password, search, tel, email and url On macOS Catalina Version 10.15.5 works as expected - aria-label or aria-labelledby attribute takes precedence over the programmatically associated label.
Created attachment 430350 [details] Patch
Comment on attachment 430350 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430350&action=review > Source/WebCore/ChangeLog:10 > + given objet, and using the label of that title element as the label of object > Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp:111 > + if (text.textSource == AccessibilityTextSource::LabelByElement && !coreObject->titleUIElement()) if we don't expose the titleUIElement, should it even be in the accessibilityText that's generated?
Created attachment 431069 [details] Patch
(In reply to chris fleizach from comment #5) > Comment on attachment 430350 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430350&action=review > > > Source/WebCore/ChangeLog:10 > > + given objet, and using the label of that title element as the label of > > object Fixed. > > > Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp:111 > > + if (text.textSource == AccessibilityTextSource::LabelByElement && !coreObject->titleUIElement()) > > if we don't expose the titleUIElement, should it even be in the > accessibilityText that's generated? This is used for aria-label, so you can have a form field, for instance, with aria-label="blah" and we want to return "blah" if there is no titleUIElement. It seems that the precedence of titleUIElement over aria-label was established at some point, but I have not check what the aria spec says about this, if any thing.
Committed r278718 (238686@main): <https://commits.webkit.org/238686@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431069 [details].