NEW 172464
AX: aria-label and aria-labelledby ignored when for-id association present on form input
https://bugs.webkit.org/show_bug.cgi?id=172464
Summary AX: aria-label and aria-labelledby ignored when for-id association present on...
Ken Petri
Reported 2017-05-22 12:50:06 PDT
Overview: If an input field has a label and the label is associated with the field using for-id association, the for-id association overrides any other labels, whether those are associated using aria-labelledby or aria-label. Example code 1 (only labels are associated via aria-labelledby): <label id="labelID-one">Label One</label> <input type="text" aria-labelledby="labelID-one labelID-two"> <span id="labelID-two">Label Two</span> Expected Result for Example code 1: When field is focused, VoiceOver reads: "Label One, Label Two, text field" Actual Result for Example code 1: (same as expected result) Example code 2 (for-id association present along with labelledby) <label id="labelID-one" for="field-one">Label One</label> <input id="field-one" type="text" aria-labelledby="labelID-one labelID-two"> <span id="labelID-two">Label Two</span> Expected Result for Example code 2: When field is focused, VoiceOver overrides for-id association and reads labelledby IDREF values: "Label One, Label Two, text field" Actual Result for Example code 2: When field is focused, VoiceOver reads only the for-id associated label: "Label One, text field" Example code 3 (for-id association present and aria-label used): <label for="field-one">Label One</label> <input id="field-one" type="text" aria-label="an aria label"> Expected Result for Example code 3: When field is focused, VoiceOver overrides for-id association and reads aria-label value: "an aria label, text field" Actual Result for Example code 3: When field is focused, VoiceOver reads only the for-id associated label: "Label One, text field" These results were verified using iOS 10.3.1 on both iPad and iPhone.
Attachments
Radar WebKit Bug Importer
Comment 1 2017-05-22 12:50:31 PDT
Devon Govett
Comment 2 2020-12-17 15:43:13 PST
This bug is still present in iOS 14. Here's another reproduction: https://codepen.io/devongovett/pen/PoGjwdG. The first slider is announced only as "Range" where the second slider is announced as "Range Maximum". VoiceOver on macOS announces the first slider correctly as "Range Minimum".
James Nurthen
Comment 3 2020-12-17 16:41:31 PST
From inspecting Safari on iPadOS this doesn't seem to be a safari bug rather a Voiceover one. The (Inspected) Accessible name looks to be correct.
Note You need to log in before you can comment on or make changes to this bug.