w3c / wcag

Web Content Accessibility Guidelines
https://w3c.github.io/wcag/guidelines/22/
Other
1.13k stars 256 forks source link

F82 is example 1 is NOT a failure of 3.3.2: Labels or Instructions #1565

Open jake-abma opened 3 years ago

jake-abma commented 3 years ago

3.3.2: Labels or Instructions is about whether there's a label or not.

3.3.2 is NOT about if the label is descriptive, see also the text in the Understanding:

While this Success Criterion requires that controls and inputs have labels, whether or not these labels are sufficiently clear or descriptive is covered separately by 2.4.6: Headings and Labels.

https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html#intent

Now in F82 is there is example 1:

Example 1 In the United States, phone numbers are broken into a three digit area code, a three digit prefix, and a four digit extension. A web page creates fixed length text input fields for the three parts of the phone number, surrounding the first field with parenthesis and separating the second and third fields with a dash. Because of this formatting, some users recognize the fields as a phone number. However, there is no text label for the phone number on the web page. This is because the label for each field will be the closest preceding text, so the three fields would be labeled "(", ")" , and "-" respectively.

Looking at the last sentence: "This is because the label for each field will be the closest preceding text, so the three fields would be labeled "(", ")" , and "-" respectively."

So, they DO have a label and thus NOT applicable for 3.3.2. but for 2.4.6.

alastc commented 3 years ago

Not read both issues, but noting this is on the same area as #755

cstrobbe commented 2 years ago

whether or not these labels are sufficiently clear or descriptive is covered separately ...

The issue with this part of Understanding 3.3.2 is that it seems to contradict the definition of label:

text or other component with a text alternative that is presented to a user to identify a component within Web content

When you say that those three fields have a label (i.e. one that meets WCAG's definition of label), the implication is that "(", ")" , and "-" can be said to "identify" the form fields that immediately follow them. To me, that verges on sophistry. (And the phrase "the punctuation is not sufficient to label the fields" in the example's description also seems to suggest that text that does not properly identify the input field is not really a label according to WCAG's definition.)